golearn

mac安装go环境

本小妞迷上赌 提交于 2020-07-25 06:09:32
下载pkg文件 https://golang.google.cn/dl/ sudo vim /etc/profile 11 export GOROOT=/usr/local/go 12 export GOPATH=${GOROOT}/gopath 13 export PATH=$PATH:${GOROOT}/bin 14 export GO111MODULE=on 15 export GOPROXY=https://goproxy.cn source /etc/profile 说明: 1. GOROOT 为go安装目录, 在mac下使用pkg包安装的, 目录为 /usr/loca/go 如果用go mod gopath 设置为/usr/local/go/gopath 查看环境 go env macdeMacBook-Pro:www mac$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/mac/Library/Caches/go-build" GOENV="/Users/mac/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE=""