$ GOPATH值在终端的新会话期间保持重置为空 [英] $GOPATH value keeps reseting to empty during new sessions of the terminal
本文介绍了$ GOPATH值在终端的新会话期间保持重置为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用golang.org的10.8+安装程序在我的Mac Book上安装了GO,并且我已经设置了一个工作区。运行这两个命令后: export GOPATH = $ HOME / go
和 export PATH = $ PATH:$ GOPATH / bin
,回显GOPATH会返回 / Users / dipen / go
的值;但是,重新启动终端后,GOPATH的回显将不会返回任何内容。
I have installed GO on my Mac Book using the 10.8+ installer from golang.org, and I have set up a workspace. After running both these commands: export GOPATH=$HOME/go
and export PATH=$PATH:$GOPATH/bin
, echoing the GOPATH does return a value of /Users/dipen/go
; however, after restarting the terminal, the echoing the GOPATH returns nothing. How can I fix this?
推荐答案
将这些行添加到〜/ .bashrc或〜/ .bash_profile中:
Add these lines to your ~/.bashrc or ~/.bash_profile:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
这篇关于$ GOPATH值在终端的新会话期间保持重置为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文