News for hackers. Stuff that matters.
Re:How I write HTTP services in Go after 13 years by pphysch on Friday February 09, 2024 @03:00PM (#39319773)
For bespoke internal services, I like to keep main.go as flat as reasonable, like a "script". Handlers can have their own files but the bulk of the control flow and moving parts should be apparent from reading the main file.

Abstracting things away from main makes it less readable and is general pointless for bespoke services that will be deployed in exactly one configuration.

Re:How I write HTTP services in Go after 13 years by donio on Friday February 09, 2024 @03:22PM (#39320027)
That's a nice way of putting it. When exploring a new codebase for the first time it can be very helpful to have main.go give you a high level idea about the overall structure of the program.