posts home

Using Go Modules To Structure Your Projects

Go modules were introduced a long time ago in Go. However I still found a hard time getting into writing using Go modules, not knowing how to structure my projects and then call those modules I wrote. Turns out its dead simple, but maybe this will be a useful learning source or reference. Generic Structure From what I’ve seen, Go projects often use /pkg to write packages written for the project - packages in here should normally be usable outside of the project, however, if they are not then /internal is what I use instead.