用apt命令在Ubuntu上安装喜欢的Go版本
将golang-backports添加到apt存储库中。
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
指定版本进行go的安装。
sudo apt install golang-1.18
设定
GOPATH=~/go
GOROOT=/usr/lib/go-1.18
PATH=$GOROOT/bin:$PATH
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-1.18
GOPATH=~/go
GOROOT=/usr/lib/go-1.18
PATH=$GOROOT/bin:$PATH