-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Description
Go version
go version go1.25.5 darwin arm64
Output of go env in your module/workspace:
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/liaotao/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/liaotao/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/j0/lcndc7t11379qbhs2v29dync0000gn/T/go-build1967855940=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/liaotao/work/kaji-server/go.mod'
GOMODCACHE='/Users/liaotao/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/liaotao/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/liaotao/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.5'
GOWORK=''
PKG_CONFIG='pkg-configWhat did you do?
I use the go build . command to build my program and then run it.
go mod file:
module app
go 1.25.5
require (
framework v1.0.0
github.com/Masterminds/semver v1.5.0
github.com/VictoriaMetrics/metrics v1.40.2
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/gomodule/redigo v1.9.2
github.com/hashicorp/go-multierror v1.1.1
github.com/spf13/viper v1.20.1
go.mongodb.org/mongo-driver/v2 v2.4.0
google.golang.org/grpc v1.76.0
google.golang.org/protobuf v1.36.6
gopkg.in/yaml.v3 v3.0.1
pb v1.0.0
pt v1.0.0
)
require (
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-playground/form/v4 v4.2.1 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f // indirect
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/valyala/fastrand v1.1.0 // indirect
github.com/valyala/histogram v1.2.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.40.0 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
)
replace framework => ../framework
replace pb => ../pb
replace pt => ../pt
freamework go.mod:
module framework
go 1.25.5
require (
github.com/VictoriaMetrics/metrics v1.40.2
github.com/bytedance/sonic v1.14.2
github.com/go-playground/form/v4 v4.2.1
github.com/gomodule/redigo v1.9.2
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/go-multierror v1.1.1
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f
go.mongodb.org/mongo-driver/v2 v2.2.0
go.uber.org/zap v1.27.0
golang.org/x/time v0.12.0
google.golang.org/grpc v1.72.0
google.golang.org/protobuf v1.36.5
)
require github.com/hashicorp/errwrap v1.0.0 // indirect
require (
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic/loader v0.4.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/jonboulle/clockwork v0.5.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/tebeka/strftime v0.1.5 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/valyala/fastrand v1.1.0 // indirect
github.com/valyala/histogram v1.2.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
)
pb go.mod:
module pb
go 1.24.1
require (
google.golang.org/grpc v1.76.0
google.golang.org/protobuf v1.36.6
)
require (
golang.org/x/net v0.42.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.27.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
)
What did you see happen?
-
go build is extremely slow.
If I clear the cache directory (delete go-build), the first compilation takes over 5 minutes. After the first compilation, even if I change just one line in a file, compilation can still take 3 to 5 minutes. -
The go-build directory keeps growing.
After the first successful compilation, the directory is about 5 GB. Later, even if I only change one line of code, the go-build directory keeps increasing, sometimes by more than 10 GB at a time. At the most extreme, my go-build directory reached 300 GB and kept growing.
What did you expect to see?
-
go build usually completes within a few seconds.
-
The go-build directory shouldn’t increase disk usage dramatically.