
代码
golang的module管理与使用go mod
sexyspace 发表于2022-03-23 浏览763 评论0
更换或升级了golang后,需要删除go.mod、go.sum、vendor文件,然后重建,不然一直卡在那里
使用:
Go modules 操作命令及相关文件解读
可以命令行执行 go help mod 打印出 go mod 相关命令:
download download modules to local cache 常用,下载依赖包 edit edit go.mod from tools or scripts ide编辑就行 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 从mod cache中拷贝到项目的vendor verify verify dependencies have expected content why