apt-get update
sudo apt-get install golang-go
go version
#修改~/.bashrc vim ~/.bashrc #添加Gopath路径 export GOPATH=/usr/local/go export PATH=$GOPATH/bin:$PATH # 激活配置 source ~/.bashrc
go env
在GOPATH路径下 创建一个 hello.go文件
package main import "fmt" func main() { fmt.Printf("hello\n") }
运行
原文:https://www.cnblogs.com/jxxiaocao/p/13822339.html