go下载:
下载地址:https://golang.google.cn/dl/
[root@server01 ~]# mkdir -p ~/support/gopath [root@server01 ~]# mv go1.15.6.linux-amd64.tar.gz ~/support [root@server01 ~]# cd support/ [root@server01 support]# tar xf go1.15.6.linux-amd64.tar.gz
[root@server01 ~]# vi .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH #go export GOROOT=~/support/go export GOPATH=~/support/gopath export PATH=${GOROOT}/bin:$PATH export PATH=${GOPATH}/bin:$PATH
source ~/.bash_profile
[root@server01 ~]# source ~/.bash_profile [root@server01 ~]# go version go version go1.15.6 linux/amd64
原文:https://www.cnblogs.com/liujunjun/p/14261579.html