Go version
go version go1.24.2 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=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/josh/bin'
GOCACHE='/Users/josh/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/josh/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/vm/htvrhp4177v2dfhdjlvl0pqh0000gn/T/go-build275806226=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD=[redacted]
GOMODCACHE='/Users/josh/pkg/mod'
GONOPROXY=[redacted]
GONOSUMDB=[redacted]
GOOS='darwin'
GOPATH='/Users/josh'
GOPRIVATE=[redacted]
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/josh/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/josh/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/josh/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.2'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
Here's my terminal transcript:
$ go run x.go
go: updates to go.mod needed; to update it:
go mod tidy
$ go mod tidy
$ go run x.go
go: updates to go.mod needed; to update it:
go mod tidy
$ go mod tidy
$ go run x.go
go: updates to go.mod needed; to update it:
go mod tidy
After quite a while spend debugging, it turns out the problem is that x.go had //go:build ignore, and so go mod tidy ignored it...leaving it in a broken state when actually running it.
Even once I had a diagnosis, it was non-trivial to work around, because go mod tidy has no place to specify build tags. I had to move the file to a new location, remove the build tag, run go mod tidy, and then put it all back together again.
What did you see happen?
covered above.
What did you expect to see?
again, covered above.
Go version
go version go1.24.2 darwin/arm64
Output of
go envin your module/workspace:What did you do?
Here's my terminal transcript:
After quite a while spend debugging, it turns out the problem is that
x.gohad//go:build ignore, and sogo mod tidyignored it...leaving it in a broken state when actually running it.Even once I had a diagnosis, it was non-trivial to work around, because
go mod tidyhas no place to specify build tags. I had to move the file to a new location, remove the build tag, rungo mod tidy, and then put it all back together again.What did you see happen?
covered above.
What did you expect to see?
again, covered above.