美文网首页
搭建golang开发环境

搭建golang开发环境

作者: 回眸淡然笑 | 来源:发表于2019-11-26 16:50 被阅读0次
 cd /www/server && yum install -y wget && wget -O golang.tar.gz https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
    tar -xzvf golang.tar.gz
    wget -O profile.txt https://lowvps.cn/wp-content/uploads/2019/05/profile.txt
    cat profile.txt >> /etc/profile
    source /etc/profile
    mkdir /www/wwwroot/Golang
    echo -e "-----------------------------------------------------------------------------------"
    echo -e "Golang环境安装成功!"
    echo -e "Golang The environment is installed successfully!"
    echo -e "-----------------------------------------------------------------------------------"
    go version

profile.txt 内容

#############################################
# golang ENV
#############################################
export GOROOT=/www/server/go
export GOBIN=$GOROOT/bin
export GOPKG=$GOROOT/pkg/tool/linux_amd64
export GOARCH=amd64
export GOOS=linux
export GOPATH=/www/wwwroot/Golang
export PATH=$PATH:$GOBIN:$GOPKG:$GOPATH/bin

source /etc/profile

相关文章

网友评论

      本文标题:搭建golang开发环境

      本文链接:https://www.haomeiwen.com/subject/xywouctx.html