英文:
go install but unable to run app from folders uther than bin
问题
在Mac电脑上,我设置了导出export GOPATH=$(pwd)。
go install运行正常,bin文件夹中包含了应用程序,但是我无法运行该应用程序/二进制文件。
英文:
On a mac computer I set the export export GOPATH=$(pwd).
go install is running fine and the bin folder contains the app, but I am unable to run the app/binary?
答案1
得分: 0
go install命令将二进制文件安装到$GOPATH/bin目录中,而该目录很可能不在您操作系统的PATH环境变量中。
您需要将$GOPATH/bin添加到您的PATH中:
export PATH=$GOPATH/bin:$PATH
英文:
go install installs a binary to $GOPATH/bin which is likely does not present in PATH env variable of your OS.
You need to add$GOPATH/bin to your PATH:
export PATH=$GOPATH/bin:$PATH
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论