gopath配置

go语言需要配置一个gopath来安放项目,安装完成之后就要设置,完整步骤如下:

$sudo gedit ~/.bashrc

export PATH="$PATH:/home/yangchao/.linuxbrew/Cellar/go/1.6.2/libexec/bin"
export PATH="$PATH:$GOPATH/bin"

export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
export GOPATH=$HOME

 如果只设置 export GOPATH=$HOME 会出现 go env可以看到gopath但是get 代码之后出现 xxx command not found的错误。

posted on 2016-10-24 18:30  seemann  阅读(234)  评论(0编辑  收藏  举报

导航