Home  >  Article  >  Backend Development  >  Introduction to how to use GVM to manage Go versions

Introduction to how to use GVM to manage Go versions

尚
forward
2020-02-22 17:13:412566browse

Go language is a statically strongly typed, compiled, concurrent programming language with garbage collection function developed by Google. Next, the go Getting Started Tutorial column will introduce to you how to use GVM to manage the Go version.

Introduction to how to use GVM to manage Go versions

Install GVM

$ bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)

After the installation is completed, a .gvm directory will be generated in the user's home directory.

$ ls -al ~/.gvm

Use GVM

View the Go environment of the current machine

$ gvm  list

gvm gos (installed)

   system

Only one system is displayed here, which is the Go version originally installed on the system .

View all installable Go versions

$ gvm listall
...

Install Go

Install two versions of Go here, switch later use.

$ gvm install go1.5 -B
$ gvm install go1.6 -B

After the installation is complete, check it out.

$ gvm list

gvm gos (installed)

   go1.5
   go1.6
   system

Switch Go version

Use Go1.5

$ gvm use go1.5

$ go version
go version go1.5 linux/amd64

Use Go1.6

$ gvm use go1.6

$ go version
go version go1.6 linux/amd64

For more go language knowledge please Pay attention to the go language tutorial column on the php Chinese website.

The above is the detailed content of Introduction to how to use GVM to manage Go versions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete