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
(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
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: