社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
go help modules
go mod命令
download download modules to local cache (下载依赖的module到本地cache))
edit edit go.mod from tools or scripts (编辑go.mod文件)
graph print module requirement graph (打印模块依赖图))
init initialize new module in current directory (再当前文件夹下初始化一个新的module, 创建go.mod文件))
tidy add missing and remove unused modules (增加丢失的module,去掉未用的module)
vendor make vendored copy of dependencies (将依赖复制到vendor下)
verify verify dependencies have expected content (校验依赖)
why explain why packages or modules are needed (解释为什么需要依赖)
初始化mod
go mod init [module]可以创建一个go.mod,只有一行信息module。
打开 Goland->File->Settings->Tool->External Tool
Name: InitModule
Program: C:Gobingo.exe
Arguments: mod init $FileDirName$
Working directory: $FileDir$
Name: RefreshModuleDependencies
Program: C:Gobingo.exe
Argument: mod tidy
Working Diretory: $FileDir$
Name: CleanModuleCache
Program: C:Gobingo.exe
Argument: clean -modcache
Working Diretory:
Name: DownloadModuleDepenencies
Program: C:Gobingo.exe
Argument: mod download
Working Diretory:
Name: CopyModuleDependencies
Program: C:Gobingo.exe
Argument: mod vendor
Working Diretory: $FileDir$
参考:
https://studygolang.com/articles/17548
Golang代理 : https://blog.csdn.net/halo_hsuh/article/details/105812077
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!