Learning Go
Learning Go
Get dev environment ready
Install Go on Mac (with homebrew)
Install go.
1
brew install golang
Setup workspace.
1
mkdir -p $HOME/go/{bin,src,pkg}
Setup environment
1
2
3
4
5
export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
source $HOME/.zshrc
Go version manager (GVM)
1
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
1
2
3
gvm listall
gvm install go1.18.0
gvm use go1.18.0 [--default]
This post is licensed under CC BY 4.0 by the author.