Install with git clone.
$ git clone https://github.com/syndbg/goenv.git ~/.goenv
Set environment variables and so on. [Slightly different] depending on the login shell and system (https://github.com/syndbg/goenv/blob/master/INSTALL.md#basic-github-checkout). The following is for Debian and bash.
$ vi ~/.bashrc
# goenv
export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
After editing, log out once.
~ / go
is the path where go-related files are placed. The ~ / go
directory is created automatically.Set up with the following command.
$ goenv install 1.13.0
$ goenv global 1.13.0
$ go version
go version go1.13 linux/amd64
~ / go
mentioned earlier.Recommended Posts