In Go project development, the team has to keep the development version consistent, how to quickly install and deploy and switch Go environment, here we recommend a tool GVM (Go Version Manager), it can easily switch and customize Go Path, Go Root and other parameters, is a real multi-version installation and management tool.
GVM, similar to RVM in ruby, can be used to easily manage Go versions. It has the following main features.
- Managing multiple versions of Go, including installing, uninstalling, and specifying a particular version of Go to use.
- View all officially available versions of Go, as well as view locally installed and default versions of Go in use.
- Manage multiple GOPATHs and edit Go’s environment variables.
- Ability to associate the current directory to GOPATH.
- You can view file differences under GOROOT.
Installing
|
|
Or, if you are using zsh
, just change bash
with zsh
.
Usage
Check the features supported by gvm.
|
|
Install Go version
For example, to install go1.13
version.
|
|
View Go version
Switching Go versions
|
|
Managing Gopath environments
GVM
provides a relatively simple tool, gvm pkgset
, to create environments that use GOPATH
.
|
|
Uninstall
Uninstall an installed version of Go.
|
|