LoginSignup
1
0

More than 3 years have passed since last update.

Golang Mac環境構築メモ

Last updated at Posted at 2019-11-28

Goのバージョンを混在させるためgoenvからGoを入れる

brew install --HEAD goenv

更新時

brew upgrade --fetch-HEAD goenv

bash_profileにgoenv関連のパスを通しておく

vim ~/.bash_profile

以下を記載して:qw

#goenv
export PATH="$HOME/.goenv/bin:$PATH"
export GOPATH=$HOME/go
eval "$(goenv init -)"

bash_profileの変更を反映

source ~/.bash_profile

goenvコマンドが叩けることの確認

goenv -v 

ここからGoの構築
goenvでインストールできるGoのバージョンを確認

goenv install -l

バージョン指定で入れる

goenv install 1.11.4

有効なバージョンに今回入れたバージョンが表示されれば成功

goenv versions

マシン全体で入れたバージョンを有効にする

goenv global 1.11.4
goenv rehash

所定のディレクトリのみで有効にしたい場合

goenv local 1.11.4
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0