Go环境配置
2021-05-10 16:46 方斌 阅读(630) 评论(0) 编辑 收藏 举报Go环境配置
Go安装
下载地址
Go环境配置
- 系统环境配置
- 电脑 属性 高级系统设置 环境变量 path中添加 go目录,例如 C:\Program Files\Go\bin
- GOPATH
- 修改 用户变量 GOPATH 为你想要的地址,例如 D:\work\go
- D:\work\go 目录下新建三个文件夹 bin pkg src
查看go环境信息
cmd go env
C:\Users\fangbin>go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\fangbin\AppData\Local\go-build
set GOENV=C:\Users\fangbin\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\work\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\work\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16.4
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\fangbin\AppData\Local\Temp\go-build1208758647=/tmp/go-build -gno-record-gcc-switches