-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: go mod tidy removes needed dependencies #65054
Labels
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Comments
mauri870
added
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
GoCommand
cmd/go
modules
labels
Jan 11, 2024
The dummy import in If you want to be able to build the package ~/src/github.com/golang/vscode-go/extension$ git diff
diff --git i/extension/doc.go w/extension/doc.go
index 53bc3ada..2fd96e3c 100644
--- i/extension/doc.go
+++ w/extension/doc.go
@@ -8,8 +8,10 @@ package extension
// Dummy command to add dependency on vscgo.
+//go:build tools
+
import (
- _ "github.com/golang/vscode-go"
+ _ "github.com/golang/vscode-go/vscgo"
)
//go:generate go run github.com/golang/vscode-go/vscgo version
~/src/github.com/golang/vscode-go/extension$ go mod tidy
~/src/github.com/golang/vscode-go/extension$ go run github.com/golang/vscode-go/vscgo version
vscgo: v0.0.0-00010101000000-000000000000
go: devel go1.22-e9b3ff15f4 Wed Jan 10 17:35:49 2024 +0000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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: