go mod命令


$ go mod <command> [arguments]
$ go help mod <command>


download    download modules to local cache
edit        edit go.mod from tools or scripts
graph       print module requirement graph
init        initialize new module in current directory
tidy        add missing and remove unused modules
vendor      make vendored copy of dependencies
verify      verify dependencies have expected content
why         explain why packages or modules are needed


$ go mod init example.com/m

// 下载缺少的、移除不用的module
$ go mod tidy