go_01_Linux 下安装 go 语言环境

TSSC_go_install_linux

  • 下载地址

https://golang.org/dl/
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.gz

1.下载安装 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
  • 完毕,呵呵呵
上一篇:DL:深度学习(神经网络)的简介、基础知识(神经元/感知机、训练策略、预测原理)、算法分类、经典案例应用之详细攻略


下一篇:iOS RunTime的简单使用