go.mod
Initialize a v0 or v1 module:
go mod init example.com/m
Initialize a v2 module:
go mod init example.com/m/v2
Inspect the code, look for module imports, download them and update go.mod.
go mod tidy