You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that really odd, as my code doesn't run on the cloud and uses nothing related to App Engine.
So I ran mod tidy hoping it'd go away (but it didn't) and then go mod why:
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod why google.golang.org/appengine
# google.golang.org/appengine
(main module does not need package google.golang.org/appengine)
Umm. More mysteries.
Turns out go mod why only accepts packages, not modules.
But I only have modules to ask about.
The way I figured this out was nuking my go.mod file and re-running tidy to see a package in the module:
There are a number of go mod sub-commands that do analysis on the full dependency graph, as you discovered. This is one reason I filled: #25873 . @rsc Has a reasonable compromise to only put this information in the vendor subcommand per comment #25873 (comment) . But as you noted, it would still leave the other analysis hanging. My original proposal to allow something like exclude tag:appengine would then affect the local modules full graph analysis and thus not try to pull in such dependencies. This would still be my preference.
I agree that go mod why should probably take a module path as well.
I was just looking in a go.mod file of mine and saw
google.golang.org/appengine
:I found that really odd, as my code doesn't run on the cloud and uses nothing related to App Engine.
So I ran
mod tidy
hoping it'd go away (but it didn't) and thengo mod why
:Umm. More mysteries.
Turns out
go mod why
only accepts packages, not modules.But I only have modules to ask about.
The way I figured this out was nuking my
go.mod
file and re-running tidy to see a package in the module:And then I saw that it was
google.golang.org/appengine/urlfetch
so I could finally run:What? Why is
oauth2/internal
depending on App Engine? Oh, it's not:https://github.com/golang/oauth2/blob/master/internal/client_appengine.go
That's behind a build tag.
Okay, so
go mod tidy
is not what I want here.Delete it all and instead tidy-by-building:
Much better.
But two requests:
go mod why
let me ask questions with modules instead of packgesgo mod tidy
and ignore the "appengine" build tag (or other build tags). Or only tidy with my current build tags, not all.The text was updated successfully, but these errors were encountered: