sparse-intern-71089
03/15/2022, 2:01 PMchilly-plastic-75584
03/31/2022, 7:44 PMproject
/pkg
/internal
/cmd
go.mod/sum
However, I'll say that I've read that things like pkg for example are kinda redudant and it's really a matter of preference. I hate giving that answer, but I looked through a lot and found so much variance. The Go community tends to avoid "this is how you should do it" and instead focuses on some things you shouldn't do.
My personal recommendation would be (in ascending order of complexity and code involved)
• Small app, all in one level directory.
• Next step: All packages that are for app and not meant to be imported in internal
and others in main project if it's a Go repo and not a big monorepo, otherwise, move into pkg
for importable.
◦ cmd is a convention that just makes it easy to discover and build stuff, so I stick with that.
Last side note... I personally adhere to every project should have mage/make files for common tasks and this means the organization of the project can vary a little without being a big deal, just run mage build
and be done even if structure changes. Highly recommend this. Been working on a template repo with Go based tasks as an example and can share that later once it's up if you are interested in seeing.
• Next step: move allred-football-97286
04/14/2022, 2:36 PMmage
, sounds similar to make
.chilly-plastic-75584
04/14/2022, 8:14 PMred-football-97286
04/14/2022, 8:30 PM