Go mod cheat sheet
A simple cheat sheet when using Go modules
This is a simple cheat sheet for go modules, listing the main commands.
Initialization
Create a new module, with automatic module path resolution.
| |
Create a new module, with explicit module path.
| |
Clean up
Prune any no-longer-needed dependencies and add any dependencies needed for other combinations of OS and architectures.
| |
Vendoring
Create a vendor directory with the exact version of the dependencies to use during build.
| |
Why
Why a module or package is being kept.
| |
Dependencies
Display the dependencies of your module.
| |
This post is licensed under CC BY 4.0.