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

2018-11-06  本文已影响0人  小隐_df8d

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

上一篇 下一篇

猜你喜欢

热点阅读