美文网首页
Mac配置Go开发环境--pkg包方式

Mac配置Go开发环境--pkg包方式

作者: 小隐_df8d | 来源:发表于2018-11-06 11:46 被阅读0次

1.控制台查看是否存在 bash_profile文件

cd~/.bash_profile

2.在该文件中增加环境变量

(1)打开

        vim~ /.bash_profile

(2)插入模式

        i

(3)输入

    #GOROOT

    exportGOROOT=/usr/local/go

    #GOPATH

    exportGOPATH=$HOME/Documents/go_workspace

    #GOROOT bin

    exportPATH=$PATH:$GOROOT/bin

    #GOPATH bin

    exportPATH=$PATH:$GOPATH/bin

3.执行该文件

    $source.bash_profile

相关文章

网友评论

      本文标题:Mac配置Go开发环境--pkg包方式

      本文链接:https://www.haomeiwen.com/subject/mlayxqtx.html