r/golang • u/Charming_Skin_8549 • 12h ago
What's coming in Go
r/golang • u/deployfan64 • 2h ago
After years of Python (I even taught a workshop on it at work), I finally got to write a real service in Go. I was processing files in a loop and used defer file.Close() inside the loop, then wondered why memory kept climbing on large batches — all those handles were staying open until the function returned, not each iteration. The fix was extracting the body into a helper function so defer fired per iteration, which is now obvious in hindsight. Lesson learned: defer is scoped to the function, not the block. Curious if others hit this their first month, or is it just me?
r/golang • u/AutoModerator • 5h ago
This is the weekly thread for Small Projects.
The point of this thread is to have looser posting standards than the main board. As such, projects are pretty much only removed from here by the mods for being completely unrelated to Go. However, Reddit often labels posts full of links as being spam, even when they are perfectly sensible things like links to projects, godocs, and an example. r/golang mods are not the ones removing things from this thread and we will allow them as we see the removals.
Please also avoid posts like "why", "we've got a dozen of those", "that looks like AI slop", etc. This the place to put any project people feel like sharing without worrying about those criteria.
I've been building sgh, a CLI for org-wide GitHub operations: branches, tags, PRs, Actions runs and branch protection. The official gh works one repository at a time; this one takes an org and runs against all of its repos. I'm the author, and it's MIT licensed.
sgh branch create --org my-org --new Release-2.0 --ref main --dry-run
sgh workflow list --org my-org --failed --branch main
sgh protected-branch list --org my-org --branch main
The parts that might interest this sub:
Code: https://github.com/pradyb/sgh-cli
Docs: https://pkg.go.dev/github.com/pradyb/sgh-cli
I'd appreciate a review of the concurrency and error-handling design, and any criticism of the package layout.
I build API Gateway for AI Agents https://github.com/Clivern/Sloth. It is using A2A protocol. check it out and let me know what do you think