Go install fails with error: no install location for directory xxx outside GOPATH

前端 未结 12 1711
醉话见心
醉话见心 2020-12-12 11:22
~/src/go-statsd-client> echo $GOPATH
/Users/me/gopath
~/src/go-statsd-client> echo $GOROOT
/usr/local/Cellar/go/1.1.1\\
~/src/go-statsd-client> go install
g         


        
12条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 12:18

    I had this problem on Windows.

    My problem was that my %GOPATH% environment variable was set to

    C:\Users\john\src\goworkspace

    instead of

    C:\Users\john\src\goworkspace\

    Adding the missing trailing slash at the end fixed it for me.

提交回复
热议问题