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
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
vim /etc/profile --------------------------------- export GOROOT=/usr/local/go export GOPATH=/usr/local/go export PATH=$GOROOT/bin:$GOPATH/bin:$PATH ---------------------------------
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