下载目录:https://golang.org/doc/install?download=go1.10.1.darwin-amd64.pkg
安装完成,安装目录为:/usr/local/go
检测是否安装成功:终端输入go
查看go版本:go version
配置环境变量:
vi ~/.zshrc
export GOROOT='/usr/local/go' export GOPATH='/Users/xinxin/Code/goworkspace/'goworkspace 创建 bin,src,pkg文件
cd /Users/xinxin/Code/goworkspace/src mkdir hello cd hello touch hello.gopackage main
import "fmt"
func main() {
fmt.Printf("hello, world\n") }cd /Users/xinxin/Code/goworkspace/src/hello
go build ./hello输出 : hello, world 测试成功,安装完成。
安装GolangIDE
https://www.jetbrains.com/go/