go_01_Linux 下安装 go 语言环境
2021-04-30 01:28
标签:oca windows get amd block Golan msi href vim https://golang.org/dl/ go_01_Linux 下安装 go 语言环境 标签:oca windows get amd block Golan msi href vim 原文地址:https://www.cnblogs.com/tssc/p/14715461.htmlTSSC_go_install_linux
https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
https://golang.org/dl/go1.16.3.windows-amd64.msi
https://golang.org/dl/go1.16.3.darwin-amd64.pkg
https://golang.org/dl/go1.16.3.src.tar.gz1.下载安装 go 软件
mkdir -p /opt/tools
cd /opt/tools
# wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
wget https://studygolang.com/dl/golang/go1.16.3.linux-amd64.tar.gz
mkdir -p /usr/local/go
tar -xvf go1.16.3.linux-amd64.tar.gz -C /usr/local/go
2.设置环境变量
vim /etc/profile
---------------------------------
export GOROOT=/usr/local/go
export GOPATH=/usr/local/go
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
---------------------------------
3.测试环境是否安装成功
mkdir -p /opt/tools/helloworld
cd /opt/tools/helloworld
vim helloworld.go
------------------------
package main
import "fmt"
func main() {
fmt.Println("HelloWorld!")
}
------------------------
# 测试配置
go run ./helloworld.go
文章标题:go_01_Linux 下安装 go 语言环境
文章链接:http://soscw.com/index.php/essay/80229.html