cannot download, /home/azhukov/go is a GOROOT, not a GOPATH


问题详情:

go环境安装好后,运行go代码也没有问题

下载govendor包的时候提示:

cannot download, /home/azhukov/go is a GOROOT, not a GOPATH

 

解决方法:

This error is caused by the go tool detecting a Go installation in your GOPATH. It's not telling you that your GOPATH is the GOROOT (that's a different message), it's telling your GOPATH looks like aGOROOT.

Cleaning out your GOPATH and running go get again will fix the error.

查看GOROOT和GOPATH配置均没有问题,后发现GOPATH文件夹下目录结构和GOROOT一样,不知道何时go在GOPATH下也安装了。

删除GOPATH文件夹下所有文件,重新执行命令,问题解决。

~

https://stackoverflow.com/questions/42809990/go-get-cannot-download-home-azhukov-go-is-a-goroot-not-a-gopath


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM