mod
Go Modules
are the standard way to manage dependencies and versioning in Go projects
init
- Initialize a module.
- This creates a
go.mod
file in cwd
go mod init github.com/username/myproject
downloads
- Downloads the modules required by the project into the local go module cache (
$GOPATH/pkg/mod
)
vendor
- Copy the dependencies from the local go module cache into the
./vendor
directory
tidy
- Remove unused dependencies
- This also performs other operations like adding the
//indirect
comment for implicit dependencies at go.mod
why
- Explains why a particular dependency is added
verify
- Checks that the dependencies in
go.mod
and go.sum
are correct