1. 程式人生 > 實用技巧 >go mod 包依賴自動管理模組3-終極篇

go mod 包依賴自動管理模組3-終極篇

go開發環境配置,用於指導開發:

lixiaomei:go_work limeihui$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/limeihui/Library/Caches/go-build"
GOENV="/Users/limeihui/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/limeihui/Documents/go_work/pkg/mod
"
GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/limeihui/Documents/go_work" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" //Mac竟然不需要配置代理,,歧視 GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++
" CGO_ENABLED="1" GOMOD="" 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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2f/f33qpdds5992h3c4nv5qclk80000gn/T/go-build323116324=/tmp/go-build -gno-record-gcc-switches -fno-common
" lixiaomei:go_work limeihui$

工程原始碼環境:::

go mod 自動管理依賴,下載工程依賴包::