no install location for directory ... outside GOPATH

我确定我的GOPATH和GOBIN都设置正确, 但是go get ./...还是会有错误no install location for directory ... outside GOPATH. (此时必须sudo go get ./...因为没有权限)

最终发现是权限问题, 运行sudo chown -R $USER $GOPATH即可. (此时go get ./...即可, 因为权限已经满足).

你可能感兴趣的:(no install location for directory ... outside GOPATH)