在Debian上優化Golang編譯速度可從以下方面入手:
go build -p [并行數]
-p 4
GOCACHE
export GOCACHE=/tmp/go-cache
-ldflags="-s -w"
go mod
GOPROXY=https://goproxy.cn
Gazelle
deptools
CGO_ENABLED=0
參考來源: