#Go project structure best practices

4 messages · Page 1 of 1 (latest)

river ember
#

What is the best practice in terms of project structure, specifically defining enums? Should I be making an enums folder and defining them all there

pale token
#

personally i just make a /enums folder and define enums in different files for organization

#

keep it simple 🤷‍♂️

willow drift
#

for enums you may find https://pkg.go.dev/golang.org/x/tools/cmd/stringer interesting - personally I don't over complicate things and I keep enums in the same package where they are used (and I recommend you do the same, see my blog for more about not overcomplicating layout)