https://golang.google.cn/doc/tutorial/getting-started
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin go version
注意一点:必须设置proxy
go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
cd
mkdir hello
cd hello
go mod init example.com/test
package main import "fmt" func main() { fmt.Println("Hello, World!") }
go mod tidy
go run .
go mod tidy