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
Ran go mod why without -m flag when the argument was a module instead of a package, leading to the message:
% go mod why github.com/labstack/echo-contrib
# github.com/labstack/echo-contrib
(main module does not need package github.com/labstack/echo-contrib)
This is unhelpful and has bitten me many times now. How do I know whether or not something in my go.mod file is a package or module? This is confusing to me and probably others.
What did you expect to see?
I expected to see which package or module was using the relevant module (or package):
% go mod why -m github.com/labstack/echo-contrib
# github.com/labstack/echo-contrib
github.com/autograde/aguis/web
github.com/labstack/echo-contrib/session
Proposal
I propose that the go mod why command should return a result either way. If the tool finds that the main module does not depend on the supplied package it should check if it depends on a corresponding module instead, obviating the need for the -m flag.
The text was updated successfully, but these errors were encountered:
bcmills
changed the title
go/cmd: go mod why should return result for both package and module
cmd/go: 'go mod why' should return module results even without '-m'
Mar 9, 2020
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran
go mod why
without -m flag when the argument was a module instead of a package, leading to the message:This is unhelpful and has bitten me many times now. How do I know whether or not something in my go.mod file is a package or module? This is confusing to me and probably others.
What did you expect to see?
I expected to see which package or module was using the relevant module (or package):
Proposal
I propose that the
go mod why
command should return a result either way. If the tool finds that the main module does not depend on the supplied package it should check if it depends on a corresponding module instead, obviating the need for the -m flag.The text was updated successfully, but these errors were encountered: