Official guide for organizing Go projects and modules
go.dev
go.dev
To be honest, it's really minimal and liberal but that is definitely better than what is by an unfortunate name collision considered the official Go layout now.
Personally I prefer a bit more rigidity in how the project is structured (/pkg/, /pkg/internal/, /cmd/) since it is more opinionated and requires less thinking. Typically my repos won't just have a Go backend but also a frontend too, and supporting assets, as well as documentation (designs, decisions, etc.)
- When are go multi-module workspaces best used?
- What should you use for the module-path argument to `go mod init` if you don't ever intend to share the repo or you don't yet know where you will be sharing it?
2. Anything is fine: just a name ("myproject"), a fake URL, a real URL. Whatever works for you.
This may seem overly simplistic and I'm not trying to be dismissive, but that's really what it comes down to. Sometimes things really are just simple.
I don't understand the desire to "standardize" and "document" everything to the microscopic detail.
- How to handle binary modules?