关于 golang 在 mac 上的环境变量设置
資深大佬 : imBossa 2
修改~/.bash_profile 后 source .bash_profile
go env 可以看到 gopath 是我设置在 bash_profile 的位置,但是关闭 shell 再打开 shell,go env 又变回原来的位置。
~ 下面只有.bash_profle,没有.zshrc
希望大神帮忙解答
大佬有話說 (12)
修改~/.bash_profile 后 source .bash_profile
go env 可以看到 gopath 是我设置在 bash_profile 的位置,但是关闭 shell 再打开 shell,go env 又变回原来的位置。
~ 下面只有.bash_profle,没有.zshrc
希望大神帮忙解答
如果你无法确定 bash 配置文件的加载顺序的话
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ “${BASH-no}” != “no” ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi