LoginSignup
1
2

More than 3 years have passed since last update.

複数バージョンのGoを扱う

Last updated at Posted at 2020-06-08

環境

OS: macOS Mojave Version 10.14.6

手順

manage-installのまま。

ソースのダウンロード

# 任意のバージョンをダウンロード
$ go get golang.org/dl/go1.14
# ~/sdk に配布
$ go1.14 download

環境変数の変更

~/.bash_profile
export GOPATH=$HOME/go
export GOROOT=$HOME/sdk/go1.14 # 追加
export PATH=$PATH:/${GOROOT}/bin:${GOPATH}/bin

その他

GOROOT and GOPATH are environment variables that define this layout. GOROOT is a variable that defines where your Go SDK is located. You do not need to change this variable, unless you plan to use different Go versions. GOPATH is a variable that defines the root of your workspace.

GoLandのWebサイトではあるが、GOPATHとGOROOTの説明が分かりやすかった。(Configuring GOROOT and GOPATH

参考

1
2
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
2