问题: go install报错no install location for directory outside GOPATH 解决: 环境变量问题。 export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN 再次执行go install即可。