cmd/go: go mod tidy removes needed dependencies #65054
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go1.22rc1
Output of
go env
in your module/workspace:What did you do?
Reorganizing our project repo structure for golang/vscode-go#3121
The desired state is
github.com/golang/vscode-go (A) module hosts a small binary.
github.com/golang/vscode-go/extension (B) module requires github.com/golang/vscode-go, to use the binary in its testing. (B->A)
https://go-review.googlesource.com/c/vscode-go/+/554316 is the CL.
To enforce B->A dependency, I've tested blank import,
go:generate
, ... like:https://go-review.googlesource.com/c/vscode-go/+/554316/9/extension/doc.go
https://go-review.googlesource.com/c/vscode-go/+/554316/9/extension/go.mod
In this state, go build works:
But if I run
go mod tidy
, this dependency is pruned.Build fails.
Extra info:
go mod tidy
v0.0.0-00010101000000-000000000000
.What did you see happen?
Enforce my tool dependency requirements, and
go mod tidy
agrees :-)What did you expect to see?
go mod tidy
removes the dependency and makes the code unbuildable state.The text was updated successfully, but these errors were encountered: