本文主要是介绍go get 错误module declares its path as: advert-tool but was required as: gitlab.xxx.com/golibrary/a,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
场景
通过go get 获取远程包出现如下错误:
go get gitlab.xxx.com/golibrary/advert-tool
go: gitlab.xxx.com/golibrary/advert-tool upgrade => v0.0.0-20210602065823-c4fb8fb28aa0
go get: gitlab.xxx.com/golibrary/advert-tool@v0.0.0-20210602065823-c4fb8fb28aa0: parsing go.mod:module declares its path as: advert-toolbut was required as: gitlab.xxx.com/golibrary/advert-tool
问题原因
gitlab.xxx.com/golibrary/advert-tool 中的mod.go 依赖module为 advert-tool,
正常应该为gitlab.xxx.com/golibrary/advert-tool
拉起项目mog.go:错误版本
拉起项目mog.go:正确版本
重新拉起就OK
go get gitlab.xxx.com/golibrary/advert-tool
后续问题
对mod.go 中module理解问题
这篇关于go get 错误module declares its path as: advert-tool but was required as: gitlab.xxx.com/golibrary/a的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!