FANDOM


可以执行go env查看go的环境变量,一般涉及到的环境变量有下面几个:

export GOPATH=~/go    #工作区

export GOBIN=$GOPATH/bin/  #工作区里面可执行文件放到bin目录,可以不用手动创建

export GOTOOLDIR=/usr/lib/go/pkg/tool/linux_amd64  #go里面像是6g等工具的位置,可以先用locate 6g等命令搜索下大概位置,再找具体工具的目录

export PATH=$PATH:$GOBIN:$GOTOOLDIR:$GOPATH  #全部导入到PATH环境变量中

将上面的内容复制到.profile末尾就可以了。

然后执行 source ~/.profile命令让环境变量立即生效


其余的一些设置可以看:http://wiki.ubuntu.org.cn/Golang

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.