“Golang”的版本间的差异
跳到导航
跳到搜索
第7行: | 第7行: | ||
tar -xvf go1.14.4.linux-amd64.tar.gz -C /usr/local/ | tar -xvf go1.14.4.linux-amd64.tar.gz -C /usr/local/ | ||
− | #加入 | + | #加入 添加到环境变量 |
echo 'export PATH=$PATH:/usr/local/go/bin' >>/etc/profile && source /etc/profile | echo 'export PATH=$PATH:/usr/local/go/bin' >>/etc/profile && source /etc/profile | ||
− | + | vi /etc/profile | |
export PATH=/usr/local/go/bin/:$PATH | export PATH=/usr/local/go/bin/:$PATH | ||
export GOPATH=/root/go/ #如果你用root运行 | export GOPATH=/root/go/ #如果你用root运行 | ||
export GOROOT=/usr/local/go/ | export GOROOT=/usr/local/go/ | ||
+ | export GOARCH=amd64 | ||
+ | export GOOS=linux | ||
+ | export GOTOOLS=$GOROOT/pkg/tool | ||
+ | export PATH=$PATH:$GOROOT/bin:$GOPATH/bin | ||
+ | |||
+ | source /etc/profile | ||
+ | |||
#export PATH=/usr/local/go/bin/:$PATH | #export PATH=/usr/local/go/bin/:$PATH | ||
#export GOPATH=/root | #export GOPATH=/root | ||
+ | |||
#以前的文章 | #以前的文章 |
2020年6月8日 (一) 08:30的版本
install
wget -c https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz tar -xvf go1.14.4.linux-amd64.tar.gz -C /usr/local/ #加入 添加到环境变量 echo 'export PATH=$PATH:/usr/local/go/bin' >>/etc/profile && source /etc/profile vi /etc/profile export PATH=/usr/local/go/bin/:$PATH export GOPATH=/root/go/ #如果你用root运行 export GOROOT=/usr/local/go/ export GOARCH=amd64 export GOOS=linux export GOTOOLS=$GOROOT/pkg/tool export PATH=$PATH:$GOROOT/bin:$GOPATH/bin source /etc/profile #export PATH=/usr/local/go/bin/:$PATH #export GOPATH=/root #以前的文章 #freebsd https://dl.google.com/go/go1.12.5.freebsd-amd64.tar.gz #linux curl -o go1.13.6.linux-amd64.tar.gz https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz tar -C /usr/local -xzf go1.12.5.freebsd-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin source /etc/profile #如果修改的是/etc/profile source $HOME/.profile #如果修改的是$HOME/.profile go version