Under Deepin (Linux) is installed Golang

Download

Google acquired from the official installation package, do not have direct access over the wall http://golang.google.cn, choose Linux installation package as go1.14.linux-amd64.tar.gzdownload stand

Decompression (i.e., installed)

Inside is a compressed gofolder, use the following command to unzip the folder to the default (habit, but not necessarily) path

sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

Configuration environment variable

Set ~/.bashrcor ~/profileformer valid for all users, which is valid for the current user, will add three important environmental variables go to the very end of the file and save and exit

export GOROOT="/usr/local/go" //golang 安装目录
export GOPATH="/home/deepiner/golang" // 自定义的 GOPATH 路径
export PATH=$PATH:/usr/local/go/bin

Become effective

source ~/.bashrcTo take effect, go envcheck the configuration is correct

Guess you like

Origin www.cnblogs.com/cinlap/p/12453144.html