$ git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh
사용하는 shell 확인
$ ls /home/{user} -alh
total 72K
drwxr-xr-x 9 ym ym 4.0K Oct 4 10:45 .
drwxr-xr-x 3 root root 4.0K Aug 22 11:56 ..
-rw------- 1 ym ym 6.5K Oct 4 11:32 .bash_history
-rw-r--r-- 1 ym ym 220 Aug 22 11:56 .bash_logout
-rw-r--r-- 1 ym ym 3.8K Oct 4 11:36 .bashrc
...
환경변수 설정
$ sudo echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
With Go 1.17 or later, the recommended way to install it is:
$ go install github.com/bazelbuild/bazelisk@latest
go: downloading github.com/bazelbuild/bazelisk v1.14.0
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/hashicorp/go-version v1.6.0
go: downloading github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d
To add it to your PATH:
$ export PATH=$PATH:$(go env GOPATH)/bin