A basic go module called example with additional handlers and data packages, which doesn’t require Git.
The key point is that a Go module that isn’t a source repo can be created, which enables local subfolders to be used as packages. This may be obvious to Go developers (as it is to me too…now), but I had to work it out the first time I created a Go project independent of my GitHub.
/data - abc.go /handlers - xyz.go go.mod main.go
Run this from the command line to generate.
$ go mod init example
module example go 1.17
package main import example/handlers ...
package handlers import example/data ...