Golang:Module And Goland配置 - Go语言中文社区

Golang:Module And Goland配置


 

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

 

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/halo_hsuh/article/details/106213176
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-06-30 08:51:20
  • 阅读 ( 2073 )
  • 分类:Goland

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢