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 have a module that has a couple layers of packages under it. The module is here. Specifically notice that the checks directory has other packages within it.
I can go mod tidy from the pkg/ directory linked above.
What did you expect to see?
A few packages that were not used possibly being removed.
What did you see instead?
Nearly all packages were removed, but some were kept. It looked like this:
and so on.
It appears that tidy is targeting only one (or a few) of the packages. Perhaps only the packages at the first level of directory depth under the pkg/ dir were analyzed?
In short, it looks like go mod tidy will not work when a module is used for multiple packages.
The text was updated successfully, but these errors were encountered:
Actually, I think this is because when I created this module, I ran go build ... and it started building literally everything in my gopath... I am opening a new issue. I believe go mod tidy is actually correct. After running a tidy, I can run go build ./... and the project builds fine!
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?
I have a module that has a couple layers of packages under it. The module is here. Specifically notice that the
checks
directory has other packages within it.I can
go mod tidy
from thepkg/
directory linked above.What did you expect to see?
A few packages that were not used possibly being removed.
What did you see instead?
Nearly all packages were removed, but some were kept. It looked like this:
and so on.
It appears that tidy is targeting only one (or a few) of the packages. Perhaps only the packages at the first level of directory depth under the
pkg/
dir were analyzed?In short, it looks like
go mod tidy
will not work when a module is used for multiple packages.The text was updated successfully, but these errors were encountered: