# Code Review

**URL:** https://forum.golangbridge.org/c/getting-help/code-review/10.md

[Latest](https://forum.golangbridge.org/latest.md) · [Categories](https://forum.golangbridge.org/categories.md)

---

## [About the Code Review category](https://forum.golangbridge.org/t/about-the-code-review-category/6012)

<div class="topic-metadata">

**Author:** [@flexd](https://forum.golangbridge.org/u/flexd)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 3:48pm UTC](https://forum.golangbridge.org/t/about-the-code-review-category/6012 "2024-09-26T15:48:43Z")

</div>

Do you have a project or some code you want someone else to take a look at? This is the place! Create a post to ask others to review your code.

---

## [Code Review: NetDisk — self-hosted Go file server (chi, pgx, local/S3, NFS gateway)](https://forum.golangbridge.org/t/code-review-netdisk-self-hosted-go-file-server-chi-pgx-local-s3-nfs-gateway/42915)

<div class="topic-metadata">

**Author:** [@MiraiNoShiori](https://forum.golangbridge.org/u/MiraiNoShiori)\
**Replies:** 2\
**Last updated:** [November 24, 2026, 10:32am UTC](https://forum.golangbridge.org/t/code-review-netdisk-self-hosted-go-file-server-chi-pgx-local-s3-nfs-gateway/42915 "2026-11-24T10:32:06Z")

</div>

Hi everyone, I’m relatively new to Go (coming from a backend-leaning full-stack background) and just pushed the first public release of NetDisk, a self-hosted file server I’ve been building: To be upfront about how i…

---

## [Is my code correct ? , I am trying to tackle the race condition problem safely using mutex and waitGroups](https://forum.golangbridge.org/t/is-my-code-correct-i-am-trying-to-tackle-the-race-condition-problem-safely-using-mutex-and-waitgroups/42022)

<div class="topic-metadata">

**Author:** [@swap72](https://forum.golangbridge.org/u/swap72)\
**Replies:** 2\
**Last updated:** [November 15, 2026, 3:53pm UTC](https://forum.golangbridge.org/t/is-my-code-correct-i-am-trying-to-tackle-the-race-condition-problem-safely-using-mutex-and-waitgroups/42022 "2026-11-15T15:53:57Z")

</div>

Please suggest correct / best approaches, solutions to this code : func main() { var counter int var mu sync.Mutex var wg sync.WaitGroup wg.Add(1) go func() { for i := 1; i \<= 3000; i++ { mu.Lock() counter…

---

## [Stop random programs from reading your Git and AWS credentials on Windows](https://forum.golangbridge.org/t/stop-random-programs-from-reading-your-git-and-aws-credentials-on-windows/42717)

<div class="topic-metadata">

**Author:** [@A998](https://forum.golangbridge.org/u/A998)\
**Replies:** 0\
**Last updated:** [October 21, 2026, 5:31pm UTC](https://forum.golangbridge.org/t/stop-random-programs-from-reading-your-git-and-aws-credentials-on-windows/42717 "2026-10-21T17:31:33Z")

</div>

Stop random programs from reading your Git and AWS credentials on Windows The problem When you use Git or the AWS CLI, your tokens and keys often sit in plain files, or in places any program running as you can read. You …

---

## [RFC: DocuDex, an offline documentation CLI for Go projects](https://forum.golangbridge.org/t/rfc-docudex-an-offline-documentation-cli-for-go-projects/42679)

<div class="topic-metadata">

**Author:** [@0xi4o](https://forum.golangbridge.org/u/0xi4o)\
**Replies:** 0\
**Last updated:** [October 14, 2026, 4:45pm UTC](https://forum.golangbridge.org/t/rfc-docudex-an-offline-documentation-cli-for-go-projects/42679 "2026-10-14T16:45:19Z")

</div>

Hello Gophers! I’m designing DocuDex, a CLI that builds API reference for every dependency in a go.mod from the module cache (via go/doc), stores it locally, and serves it in a browser or to a coding agent — fully offlin…

---

## [Tenant-core: a native multi-tenancy toolkit for Go](https://forum.golangbridge.org/t/tenant-core-a-native-multi-tenancy-toolkit-for-go/42442)

<div class="topic-metadata">

**Author:** [@sylvinhio](https://forum.golangbridge.org/u/sylvinhio)\
**Replies:** 2\
**Last updated:** [September 8, 2026, 11:24am UTC](https://forum.golangbridge.org/t/tenant-core-a-native-multi-tenancy-toolkit-for-go/42442 "2026-09-08T11:24:10Z")

</div>

Hi everyone, I’d like to share tenant-core, a Go toolkit for multi-tenant SaaS applications. \*\*The problem it addresses:\*\* in a multi-tenant system, every request needs to resolve which tenant it belongs to, and every …

---

## [I built Cult, an AI-native programming language/runtime in Go — looking for Gophers to test V1](https://forum.golangbridge.org/t/i-built-cult-an-ai-native-programming-language-runtime-in-go-looking-for-gophers-to-test-v1/42398)

<div class="topic-metadata">

**Author:** [@Oculis-Max](https://forum.golangbridge.org/u/Oculis-Max)\
**Replies:** 0\
**Last updated:** [August 17, 2026, 8:14pm UTC](https://forum.golangbridge.org/t/i-built-cult-an-ai-native-programming-language-runtime-in-go-looking-for-gophers-to-test-v1/42398 "2026-08-17T20:14:58Z")

</div>

I’ve been building Cult, an AI-native programming language and application runtime, with the runtime/tooling implemented in Go. Cult treats agents, models, tools, memory, permissions and human approval as first-class pr…

---

## [Parallel Execution with Semaphore instead of WaitGroup](https://forum.golangbridge.org/t/parallel-execution-with-semaphore-instead-of-waitgroup/42251)

<div class="topic-metadata">

**Author:** [@falco467](https://forum.golangbridge.org/u/falco467)\
**Replies:** 6\
**Last updated:** [August 10, 2026, 2:02pm UTC](https://forum.golangbridge.org/t/parallel-execution-with-semaphore-instead-of-waitgroup/42251 "2026-08-10T14:02:52Z")

</div>

I recently reworked my helper function for parallel execution to use a simple Semaphore to limit concurrency with a clean and simple loop. It effectively behaves like a worker pool, running at most \`pCount\` concurrent go…

---

## [\# Help I am trying to figure out if my Redis and Postgres approach's safe for running multiple instances of a background worker](https://forum.golangbridge.org/t/help-i-am-trying-to-figure-out-if-my-redis-and-postgres-approachs-safe-for-running-multiple-instances-of-a-background-worker/42336)

<div class="topic-metadata">

**Author:** [@Atu](https://forum.golangbridge.org/u/Atu)\
**Replies:** 0\
**Last updated:** [August 6, 2026, 6:36am UTC](https://forum.golangbridge.org/t/help-i-am-trying-to-figure-out-if-my-redis-and-postgres-approachs-safe-for-running-multiple-instances-of-a-background-worker/42336 "2026-08-06T06:36:51Z")

</div>

Context / the project: I’m building Protoverse, a tick-based space strategy game backend, mostly as a learning project to go deep on Go concurrency + a real multi-service architecture The idea: players send commands over…

---

## [Hookbound: secure inbound and outbound webhooks for Go](https://forum.golangbridge.org/t/hookbound-secure-inbound-and-outbound-webhooks-for-go/42185)

<div class="topic-metadata">

**Author:** [@kzelealem](https://forum.golangbridge.org/u/kzelealem)\
**Replies:** 0\
**Last updated:** [July 14, 2026, 5:39pm UTC](https://forum.golangbridge.org/t/hookbound-secure-inbound-and-outbound-webhooks-for-go/42185 "2026-07-14T17:39:57Z")

</div>

Hi everyone, I’ve released Hookbound v0.2.0, an Apache-2.0 Go library for securely sending and receiving webhooks. Hookbound provides: Signed outbound webhook delivery Inbound signature verification Standard W…

---

## [Feedback wanted: typed SQL query builder API for Go](https://forum.golangbridge.org/t/feedback-wanted-typed-sql-query-builder-api-for-go/41955)

<div class="topic-metadata">

**Author:** [@SennovE](https://forum.golangbridge.org/u/SennovE)\
**Replies:** 0\
**Last updated:** [May 27, 2026, 11:20am UTC](https://forum.golangbridge.org/t/feedback-wanted-typed-sql-query-builder-api-for-go/41955 "2026-05-27T11:20:22Z")

</div>

I’m working on qrafter, a small typed SQL query builder for Go. GitHub: GitHub - SennovE/qrafter: Qrafter forges dialect-aware SQL queries directly from your Go structs. · GitHub The goal is not to replace SQL with an …

---

## [Review my pipeline pattern in go (new to the language)](https://forum.golangbridge.org/t/review-my-pipeline-pattern-in-go-new-to-the-language/41942)

<div class="topic-metadata">

**Author:** [@DayDreamer](https://forum.golangbridge.org/u/DayDreamer)\
**Replies:** 3\
**Last updated:** [May 25, 2026, 10:18pm UTC](https://forum.golangbridge.org/t/review-my-pipeline-pattern-in-go-new-to-the-language/41942 "2026-05-25T22:18:35Z")

</div>

Hello Everyone, I am new to go language and learning the concurrency in go and one of the common patterns is “pipeline“. Below is my take on the pattern, please feel free to review it and let me know what all I can impr…

---

## [ZIN Engine - Write HTML like it’s 2025 (but without the frameworks)](https://forum.golangbridge.org/t/zin-engine-write-html-like-it-s-2025-but-without-the-frameworks/39268)

<div class="topic-metadata">

**Author:** [@cttricks](https://forum.golangbridge.org/u/cttricks)\
**Replies:** 6\
**Last updated:** [March 11, 2026, 12:00pm UTC](https://forum.golangbridge.org/t/zin-engine-write-html-like-it-s-2025-but-without-the-frameworks/39268 "2026-03-11T12:00:00Z")

</div>

I’ve been working on ZIN Engine — a lightweight server + templating engine that lets me write plain .html and still use things like loops, API data, forms, and dynamic content — without touching a framework or build ste…

---

## [I want to understand why 4s taken to send http request using golang package](https://forum.golangbridge.org/t/i-want-to-understand-why-4s-taken-to-send-http-request-using-golang-package/38575)

<div class="topic-metadata">

**Author:** [@balamurali](https://forum.golangbridge.org/u/balamurali)\
**Replies:** 4\
**Last updated:** [February 16, 2026, 10:39am UTC](https://forum.golangbridge.org/t/i-want-to-understand-why-4s-taken-to-send-http-request-using-golang-package/38575 "2026-02-16T10:39:28Z")

</div>

Here is my observation I have multiple fqdn configured and will try to reach it one by one but only one will respond http2 response and others will fail. I have configured clientTimeout 2s in http.Client and will try fir…

---

## [Raghav Hinduja Switzerland (Swiss) - How do I handle JSON unmarshalling for nested structs?](https://forum.golangbridge.org/t/raghav-hinduja-switzerland-swiss-how-do-i-handle-json-unmarshalling-for-nested-structs/41543)

<div class="topic-metadata">

**Author:** [@raghavhinduja](https://forum.golangbridge.org/u/raghavhinduja)\
**Replies:** 2\
**Last updated:** [January 31, 2026, 4:32pm UTC](https://forum.golangbridge.org/t/raghav-hinduja-switzerland-swiss-how-do-i-handle-json-unmarshalling-for-nested-structs/41543 "2026-01-31T16:32:37Z")

</div>

Hi, I am Raghav Hinduja, a Switzerland-based IT professional. Can anyone explain How to handle JSON unmarshalling for nested structs? Thanks, Regards Raghav Hinduja

---

## [Request to Participate and Share Academic Survey on Code Review in OSS Security](https://forum.golangbridge.org/t/request-to-participate-and-share-academic-survey-on-code-review-in-oss-security/41533)

<div class="topic-metadata">

**Author:** [@Md\_Niaz\_Morshed](https://forum.golangbridge.org/u/Md_Niaz_Morshed)\
**Replies:** 0\
**Last updated:** [January 28, 2026, 9:30pm UTC](https://forum.golangbridge.org/t/request-to-participate-and-share-academic-survey-on-code-review-in-oss-security/41533 "2026-01-28T21:30:44Z")

</div>

Hello, I hope you are doing well. My name is Md Niaz Morshed (\[mmorshed@crimson.ua.edu\]), and I am a PhD candidate at the University of Alabama conducting an academic survey titled “Understanding Information Needs When…

---

## [Using AI in Go programs](https://forum.golangbridge.org/t/using-ai-in-go-programs/41438)

<div class="topic-metadata">

**Author:** [@Strashimir\_Yosifov](https://forum.golangbridge.org/u/Strashimir_Yosifov)\
**Replies:** 0\
**Last updated:** [January 6, 2026, 5:41pm UTC](https://forum.golangbridge.org/t/using-ai-in-go-programs/41438 "2026-01-06T17:41:23Z")

</div>

I’ve put together a beginner’s guide, accompanied by a project on using AI in Go programs. Fellow programmers interested in the question can view it here: https://github.com/syosifov/go-beginners-genai-tutorial/blob/main…

---

## [Building a Weather App in Go with OpenWeather API](https://forum.golangbridge.org/t/building-a-weather-app-in-go-with-openweather-api/38479)

<div class="topic-metadata">

**Author:** [@andro57](https://forum.golangbridge.org/u/andro57)\
**Replies:** 1\
**Last updated:** [December 2, 2025, 9:14am UTC](https://forum.golangbridge.org/t/building-a-weather-app-in-go-with-openweather-api/38479 "2025-12-02T09:14:29Z")

</div>

I recently wrote a detailed guide on building a weather app in Go using the OpenWeather API. It covers making API calls, parsing JSON data, and displaying the results. If you’re interested, here’s the link: Building a We…

---

## [Http client io reader changed file Magic Number](https://forum.golangbridge.org/t/http-client-io-reader-changed-file-magic-number/41322)

<div class="topic-metadata">

**Author:** [@LIANGQI0811](https://forum.golangbridge.org/u/LIANGQI0811)\
**Replies:** 3\
**Last updated:** [November 26, 2025, 5:58am UTC](https://forum.golangbridge.org/t/http-client-io-reader-changed-file-magic-number/41322 "2025-11-26T05:58:13Z")

</div>

I encountered a very strange situation. this is the code func LoadHttpImage(url string) (image.Image, error) { client := http.Client{ Timeout: 5 \* time.Second, } resp, err := client.Get(url) if err != nil { ret…

---

## [Passing array as args (robotgo keytoggle)](https://forum.golangbridge.org/t/passing-array-as-args-robotgo-keytoggle/41271)

<div class="topic-metadata">

**Author:** [@Andrew\_Stratton](https://forum.golangbridge.org/u/Andrew_Stratton)\
**Replies:** 14\
**Last updated:** [November 12, 2025, 11:27am UTC](https://forum.golangbridge.org/t/passing-array-as-args-robotgo-keytoggle/41271 "2025-11-12T11:27:34Z")

</div>

I am trying to toggle a key with modifiers using robotgo. The function I am calling is KeyToggle; for me takes something like robotgo.KeyToggle(“a”, “up”, “alt”, “cmd”). I have the code below that compiles and builds a…

---

## [Bubbletea and stacking styles with Lipgloss?](https://forum.golangbridge.org/t/bubbletea-and-stacking-styles-with-lipgloss/39271)

<div class="topic-metadata">

**Author:** [@torimus](https://forum.golangbridge.org/u/torimus)\
**Replies:** 3\
**Last updated:** [August 22, 2025, 8:19pm UTC](https://forum.golangbridge.org/t/bubbletea-and-stacking-styles-with-lipgloss/39271 "2025-08-22T20:19:03Z")

</div>

want to achieve: Produce colored output over other colored output, with underlying uncovered output preserved. my attempt: bellow, where model is Bubbletea’s model interface implementation import gloss "github.com/char…

---

## [I'm new Go. My first project is todoapp](https://forum.golangbridge.org/t/im-new-go-my-first-project-is-todoapp/40796)

<div class="topic-metadata">

**Author:** [@27vhd](https://forum.golangbridge.org/u/27vhd)\
**Replies:** 2\
**Last updated:** [September 8, 2025, 6:26pm UTC](https://forum.golangbridge.org/t/im-new-go-my-first-project-is-todoapp/40796 "2025-09-08T18:26:28Z")

</div>

I’m new go. This my first project.

---

## [Built a simple task manager CLI in Go](https://forum.golangbridge.org/t/built-a-simple-task-manager-cli-in-go/40783)

<div class="topic-metadata">

**Author:** [@peter\_aluya](https://forum.golangbridge.org/u/peter_aluya)\
**Replies:** 1\
**Last updated:** [September 8, 2025, 3:12pm UTC](https://forum.golangbridge.org/t/built-a-simple-task-manager-cli-in-go/40783 "2025-09-08T15:12:27Z")

</div>

I decided to use the learn by building approach and built a simple task manager CLI. I previously built something similar, but smaller, with JavaScript in the past, and I’m happy to do it again (and more in Go). Your fee…

---

## [Use Camera Device On Windows](https://forum.golangbridge.org/t/use-camera-device-on-windows/27778)

<div class="topic-metadata">

**Author:** [@Eli](https://forum.golangbridge.org/u/Eli)\
**Replies:** 1\
**Last updated:** [August 26, 2025, 8:45pm UTC](https://forum.golangbridge.org/t/use-camera-device-on-windows/27778 "2025-08-26T20:45:16Z")

</div>

Hello, guys I am facing some troubles with the following code which aims to take a picture using windows api. When I run this code the led of my webcam turns on for few seconds (indicating that the camera was called), an…

---

## [Embedded struct tag reflect](https://forum.golangbridge.org/t/embedded-struct-tag-reflect/39140)

<div class="topic-metadata">

**Author:** [@Andrew\_Stratton](https://forum.golangbridge.org/u/Andrew_Stratton)\
**Replies:** 2\
**Last updated:** [June 30, 2025, 9:12pm UTC](https://forum.golangbridge.org/t/embedded-struct-tag-reflect/39140 "2025-06-30T21:12:37Z")

</div>

I am trying to recurse through the struct tags for embedded structs. This is the initial code, which gives a shallow report of struct tags package main import ( "fmt" "reflect" ) type Child struct { AA string \`nam…

---

## [My Golang Training](https://forum.golangbridge.org/t/my-golang-training/39122)

<div class="topic-metadata">

**Author:** [@hwpplayer1](https://forum.golangbridge.org/u/hwpplayer1)\
**Replies:** 0\
**Last updated:** [June 28, 2025, 4:58pm UTC](https://forum.golangbridge.org/t/my-golang-training/39122 "2025-06-28T16:58:40Z")

</div>

Hello I started learning go programming language again. I finished an online course and wrote the examples to our repository. Please have a look at it and fork it :slight\_smile: Happy hacking !

---

## [My Golang Training](https://forum.golangbridge.org/t/my-golang-training/39121)

<div class="topic-metadata">

**Author:** [@hwpplayer1](https://forum.golangbridge.org/u/hwpplayer1)\
**Replies:** 0\
**Last updated:** [June 28, 2025, 4:55pm UTC](https://forum.golangbridge.org/t/my-golang-training/39121 "2025-06-28T16:55:48Z")

</div>

Hello I started learning go programming language again. I finished an online course. I wrote the code into our repository. Please have a look at and fork it :slight\_smile: happy hacking !

---

## [New Go library: Queryfy / Request For Comments](https://forum.golangbridge.org/t/new-go-library-queryfy-request-for-comments/39019)

<div class="topic-metadata">

**Author:** [@haitch](https://forum.golangbridge.org/u/haitch)\
**Replies:** 0\
**Last updated:** [June 14, 2025, 12:16am UTC](https://forum.golangbridge.org/t/new-go-library-queryfy-request-for-comments/39019 "2025-06-14T00:16:37Z")

</div>

Hello community, it’s my first time here and I’m learning the ropes. I’m developing Queryfy, a library for validating and querying map\[string\]interface{} data with compile-time safety. The problem: Working with dynamic…

---

## [Feedback on avoiding duplicate text lookup values at compile time](https://forum.golangbridge.org/t/feedback-on-avoiding-duplicate-text-lookup-values-at-compile-time/38917)

<div class="topic-metadata">

**Author:** [@Andrew\_Stratton](https://forum.golangbridge.org/u/Andrew_Stratton)\
**Replies:** 3\
**Last updated:** [June 13, 2025, 11:58am UTC](https://forum.golangbridge.org/t/feedback-on-avoiding-duplicate-text-lookup-values-at-compile-time/38917 "2025-06-13T11:58:42Z")

</div>

I want to have lookup strings that are unique at compile time for the local package. I have the following : type Key int const ( txt Key = iota + 1 greeting // can't add txt again here - \*\*compile\*\* will fail newK…

---

## [Design/Code choice : Method chaining vs Reflection](https://forum.golangbridge.org/t/design-code-choice-method-chaining-vs-reflection/38910)

<div class="topic-metadata">

**Author:** [@Andrew\_Stratton](https://forum.golangbridge.org/u/Andrew_Stratton)\
**Replies:** 2\
**Last updated:** [May 30, 2025, 12:48pm UTC](https://forum.golangbridge.org/t/design-code-choice-method-chaining-vs-reflection/38910 "2025-05-30T12:48:18Z")

</div>

I have a need to create a UI (output as html eventually) and I am trying to decide between using method chaining for creating the UI, or using structs with struct tag aliases (like the standard JSON which I have used) M…

[Next page](https://forum.golangbridge.org/c/getting-help/code-review/10.md?page=1)
