package management in Go, seems like it's finally coming together
1 module per repo, everything in a module is versioned together
whatever the module name is in go.mod
is the name that is used when importing it
you can't add v0
or v1
to the end even if you wanted
import "<module name>"
import "<module name>/subpackage"
think of every version 2+ as a new module
import "<module name>/v2"
import "<module name>/v2/subpackage"
or just delete go.mod
and go.sum
and have it recalculate all dependencies
go get -u=patch
go get -u
edit all import paths
import "<module name>" => import "<module name>/v2"
import "<module name>/subpackage" => import "<module name>/v2/subpackage"
or just don't version and make everyone live on master
go mod init <module name>
git tag v0.x.x
git tag v1.x.x
git push --tags
edit go.mod
module <module name> => module <module name>/v2
git tag v2.x.x
git push --tags
realm of confusion, avoid if possible
no conflict in module scope,
versioning may be be recorded s pseudo versions
due to only a single ambiguous VCS tag
root/
|- package1/
| `- gp.mod
`- package2/
`- go.mod
the root module includes everything except stuff in subdir,
subdir has its own module name and versioning,
versions may be recorded as pseudo versions
created from time and git commits instead of tags
root/
|- go.mod
`- subdir
`- go.mod