2020-05-08 13:39:36 +01:00
|
|
|
# go mod
|
|
|
|
|
2020-05-11 05:08:42 +01:00
|
|
|
> Module maintenance.
|
|
|
|
> More information: <https://golang.org/cmd/go/#hdr-Module_maintenance>.
|
|
|
|
|
|
|
|
- Initialize new module in current directory:
|
|
|
|
|
|
|
|
`go mod init {{moduleName}}`
|
2020-05-08 13:39:36 +01:00
|
|
|
|
|
|
|
- Download modules to local cache:
|
|
|
|
|
|
|
|
`go mod download`
|
|
|
|
|
|
|
|
- Add missing and remove unused modules:
|
|
|
|
|
|
|
|
`go mod tidy`
|
|
|
|
|
2020-05-11 05:08:42 +01:00
|
|
|
- Verify dependencies have expected content:
|
|
|
|
|
|
|
|
`go mod verify`
|
|
|
|
|
2020-05-14 17:01:50 +01:00
|
|
|
- Copy sources of all dependencies into the vendor directory:
|
2020-05-08 13:39:36 +01:00
|
|
|
|
|
|
|
`go mod vendor`
|