2025-03-14 21:59:59 -06:00
|
|
|
# go mod
|
|
|
|
|
|
|
|
|
|
> Module maintenance.
|
2025-07-24 22:27:13 -06:00
|
|
|
> More information: <https://pkg.go.dev/cmd/go#hdr-Module_maintenance>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Initialize new module in current directory:
|
|
|
|
|
|
|
|
|
|
`go mod init {{moduleName}}`
|
|
|
|
|
|
|
|
|
|
- Download modules to local cache:
|
|
|
|
|
|
|
|
|
|
`go mod download`
|
|
|
|
|
|
|
|
|
|
- Add missing and remove unused modules:
|
|
|
|
|
|
|
|
|
|
`go mod tidy`
|
|
|
|
|
|
|
|
|
|
- Verify dependencies have expected content:
|
|
|
|
|
|
|
|
|
|
`go mod verify`
|
|
|
|
|
|
|
|
|
|
- Copy sources of all dependencies into the vendor directory:
|
|
|
|
|
|
|
|
|
|
`go mod vendor`
|