Introduction to how to use GVM to manage Go versions

Release: 2020-02-22 17:13:41
forward
2555 people have browsed it

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)
Copy after login

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

$ ls -al ~/.gvm
Copy after login

Use GVM

View the Go environment of the current machine

$ gvm  list

gvm gos (installed)

   system
Copy after login

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

View all installable Go versions

$ gvm listall
...
Copy after login

Install Go

Install two versions of Go here, switch later use.

$ gvm install go1.5 -B
$ gvm install go1.6 -B
Copy after login

After the installation is complete, check it out.

$ gvm list

gvm gos (installed)

   go1.5
   go1.6
   system
Copy after login

Switch Go version

Use Go1.5

$ gvm use go1.5

$ go version
go version go1.5 linux/amd64
Copy after login

Use Go1.6

$ gvm use go1.6

$ go version
go version go1.6 linux/amd64
Copy after login

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!

Related labels:
go
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template