HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

go mod — Module maintenance. More information: <https://pkg.go.dev/cmd/go#hdr-Module_maintenance>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
httpsmodulemaintenancecommandgo modcliinformationmore

Problem

How to use the go mod command: Module maintenance. More information: <https://pkg.go.dev/cmd/go#hdr-Module_maintenance>.

Solution

go mod — Module maintenance. More information: <https://pkg.go.dev/cmd/go#hdr-Module_maintenance>.

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

Code Snippets

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

Context

tldr-pages: common/go mod

Revisions (0)

No revisions yet.