【golang基础】golang环境变量

go环境变量

[root@bogon ~]# go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE="git.cloud.top"
GONOPROXY="git.cloud.top"
GONOSUMDB="git.cloud.top"
GOOS="linux"
GOPATH="/root/go/" //Go语言工作目录
GOPRIVATE="git.cloud.top"
GOPROXY="https://goproxy.io/" //GOPROXY代理
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build449229643=/tmp/go-build -gno-record-gcc-switches"

例如设置
go env -w GOPROXY=https://goproxy.io

上一篇:RateLimiter之-tryAcquire(int permits, long timeout, TimeUnit unit)


下一篇:GUAVA-RateLimit