我试图安装一个包,但即使我的 ROOT 目录设置正确,也会出现以下问题。
p@p-ubuntu:~/ba/docker-lvm-plugin$ which go
/usr/bin/go
p@p-ubuntu:~/ba/docker-lvm-plugin$ echo $GOROOT
/usr/bin/go
p@p-ubuntu:~/ba/docker-lvm-plugin$ go get github.com/Sirupsen/logrus
go: cannot find GOROOT directory: /usr/bin/go
最佳答案
如果发出 go env
则可能会返回以下内容:
set GOPATH=C:\Users\user\go
set GOROOT=C:\tools\go
什么是 GOPATH
?
Create your workspace directory,
%USERPROFILE%\go
. (If you'd like to use a different directory, you will need to set theGOPATH
environment variable; see How to Write Go Code for details.)
什么是 GOROOT
?
If you chose a directory other than c:\Go, you must set the GOROOT environment variable to your chosen path.
关于go: 找不到 GOROOT 目录:/usr/bin/go,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44954007/