当前位置:网站首页>Golang version management GVM
Golang version management GVM
2022-07-26 21:28:00 【Zhang San admin】
Today Xiaotu brings an article about Go Version Manager gvm Short essay . I don't say much nonsense , Start installation .
install
If you use it mac,mac You need to install xcode-select, Students who have not been installed can perform the installation according to the following commands , There is not much explanation here .
xcode-select --install
brew update
brew install mercurial
according to github Above instructions , Here we download according to the command line gvm-installer Installation , Students with terminal execution problems can also go to gvm-installer Page progress clone install .
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
Cloning from https://github.com/moovweb/gvm.git to /Users/admin/.gvm
Created profile for existing install of Go at "/opt/homebrew/Cellar/go/1.18.1/libexec"
Installed GVM v1.0.22
Please restart your terminal session or to get started right away run
`source /Users/admin/.gvm/scripts/gvm`
Next, in order to make gvm take effect , You need to execute the above prompt source /Users/admin/.gvm/scripts/gvm Command is enough , After execution, it can be used in the new terminal gvm To switch control go Version of the .
Use
installed , Let's have a brief look gvm Some functions supported by . Now you can call gvm Of help Options. .
$gvm help
Usage: gvm [command]
Description:
GVM is the Go Version Manager
Commands:
version - print the gvm version number # see gvm Version of
get - gets the latest code (for debugging) # Get the latest code ( Generally for debugging )
use - select a go version to use (--default to set permanently) # Choose to use Go edition (--default It can be set permanently )
diff - view changes to Go root # see Go root Changes in
help - display this usage text
implode - completely remove gvm # Completely delete gvm And all installed Go Versions and packages
install - install go versions # Install a version of Go
uninstall - uninstall go versions # Uninstall a version of Go
cross - install go cross compilers # Install cross platform Go compiler
linkthis - link this directory into GOPATH # Link the project path to GOPATH in
list - list installed go versions # List the installed Go Version list
listall - list available versions # List available Go edition
alias - manage go version aliases # management Go Version alias
pkgset - manage go packages sets # management Go Package settings
pkgenv - edit the environment for a package set # edit Go Environment of package collection
gvm Simple use
Through the first gvm listall Order to see the current Go Version list , as follows , The list is too long , here Go1-15 The version list of is omitted , It can be seen that the latest is Go1.19 Of beta And a few rc Version of the . Then let's download Go1.19 Of rc Version as an example .
$gvm listall
gvm gos (available)
go1
...
go1.16
go1.16beta1
go1.16rc1
go1.16.1
go1.16.2
go1.16.3
go1.16.4
go1.16.5
go1.16.6
go1.16.7
go1.16.8
go1.16.9
go1.16.10
go1.16.11
go1.16.12
go1.16.13
go1.16.14
go1.16.15
go1.17
go1.17beta1
go1.17rc1
go1.17rc2
go1.17.1
go1.17.2
go1.17.3
go1.17.4
go1.17.5
go1.17.6
go1.17.7
go1.17.8
go1.17.9
go1.17.10
go1.17.11
go1.17.12
go1.18
go1.18beta1
go1.18beta2
go1.18rc1
go1.18.1
go1.18.2
go1.18.3
go1.18.4
go1.19beta1
go1.19rc1
go1.19rc2
release.r56
release.r57
release.r58
release.r59
release.r60
release.r57.1
release.r57.2
release.r58.1
release.r58.2
release.r60.1
release.r60.2
release.r60.3
To install a Go edition First look at the currently used Go edition , Xiaotu uses go1.18.1 Version of .
$go version
go version go1.18.1 darwin/arm64
Install a new Go1.19 Of rc1 edition .
$gvm install go1.19rc1
Installing go1.19rc1...
* Compiling...
go1.19rc1 successfully installed!
Version switch Next , Let's switch and download it go edition , Use here gvm use version You can switch .
$gvm use go1.19rc1
Now using version go1.19rc1
How to switch permanently ? add --default You can permanently set , You can create a new terminal to execute go version, Verify view Go Whether the version is completely switched .
$gvm use go1.19rc1 --default
Now using version go1.19rc1
And then we use go version View the currently used Go edition , It seems that the switch is successful . Then you can switch freely Go Version of the . Especially when debugging is different Go The problem code caused by version is particularly useful .
$go version
go version go1.19rc1 darwin/arm64
Upgrade troubleshooting If upgrading Go In the process ,gvm The status of the file is disordered or has other problems , Can be executed by rm -rf ~/.gvm To delete gvm Conduct problem fix.
goland Use in You still need to copy the current version to a certain directory , Then set the goroot
Pay attention to me Get more good articles

边栏推荐
- Smooth scroll to element
- js点击图片打印图像
- We were tossed all night by a Kong performance bug
- Summary of common interview questions on computer network, including answers
- Object.getOwnPropertyNames() VS Object.keys()
- 加载 iframe 时显示加载指示器
- (C语言)浅识#define
- 牛客多校-Journey-(建图distra+卡常优化)
- 平滑滚动到元素
- ECCV 2022 | 同时完成四项跟踪任务!Unicorn: 迈向目标跟踪的大统一
猜你喜欢

Serial port communication failure

ECCV 2022 | 同时完成四项跟踪任务!Unicorn: 迈向目标跟踪的大统一

Redis hash和string的区别

APaaS低代码平台(一) | 把复杂留给自己,把简单留给用户

功能尝鲜 | 解密 Doris 复杂数据类型 ARRAY

Apaas low code platform (I) | leave complexity to yourself and simplicity to users

【HCIA安全】NAT网络地址转换

The hardest lesson we learned from the crypto Market

Practice of microservice in solving Library Download business problems

How to use multiple languages in a project?
随机推荐
【音视频】ijkplayer播放器参数说明文档
在上传之前预览图像
[must read new] Keya valuation analysis of University of technology, heating energy-saving products
【Flutter -- GetX】弹框 - Dialog、Snackbar、BottomSheet
如何在一个项目中使用多种不同的语言?
Rare discounts on Apple's official website, with a discount of 600 yuan for all iphone13 series; Chess robot injured the fingers of chess playing children; Domestic go language lovers launch a new pro
[HCIA security] bidirectional nat
洛谷-线段覆盖-(区间排序问题总结)
Flutter Performance Optimization Practice - UI chapter
js中join方法
Drag and drop table rows
[Oracle training] - deploy Ogg known as zero downtime migration
Show load indicator when loading iframe
Industrial basic IFC - extract model structure tree
[MySQL series] - how much do you know about the index
ROS2获取当前系统时间的方法
Sort the table by clicking on the header
Is it reliable, reliable and safe to open an account with a low commission for funds in Galaxy Securities
除了「加机器」,其实你的微服务还能这样优化
Placeholder of contentedable element