golangのアップデートとGopathの設定

Go言語が既に導入していたのでアップデートして最新版にする。これでversion1.6になった

$ sudo brew upgrade go
==> Upgrading 1 outdated package, with result:
go 1.6
==> Upgrading go
==> Downloading https://homebrew.bintray.com/bottles/go-1.6.el_capitan.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring go-1.6.el_capitan.bottle.2.tar.gz
==> Caveats
As of go 1.2, a valid GOPATH is required to use the `go get` command:
  https://golang.org/doc/code.html#GOPATH

You may wish to add the GOROOT-based install location to your PATH:
  export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
  /usr/local/Cellar/go/1.6: 5,771 files, 324.9M

GOPATHを設定するということで調べてみると適当に決めて良いらしい。

ということで$HOME/.goにする。

$ mkdir -p $HOME/.go
$ echo "export GOPATH=$HOME/.go" >> ~/.bash_profile

あ、でもエディタでいつも Working/*** にプロジェクト作っているから都度 gopath 切り替えるのが良いのか。


コメントを残す

Created by roguer.info 2016