【发布时间】:2018-04-24 11:06:12
【问题描述】:
在 Go 在 Github 上的 wiki 页面中,它被告知设置在 ~/.bash_profile 中:
https://github.com/golang/go/wiki/Setting-GOPATH
在这个 StackOverflow 问题中,大多数投票最多的答案建议设置在 ~/.bashrc 文件中:
how do I SET the GOPATH environment variable on Ubuntu? What file must I edit?
我已经读到 ~/.profile 可能是设置环境变量的最佳方式。是否有原因 ~/.profile 不用于设置 $GOPATH 还是只是偏好问题?
【问题讨论】:
-
建议
.bashrc的答案不正确,不知道原因的人太多了。
标签: go environment-variables gopath