Skip to content
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 why exit status should be non-zero if module is not used #30721

Open
rogpeppe opened this issue Mar 10, 2019 · 2 comments
Open
Labels
modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Mar 10, 2019

$ go version
go version devel +ce7534ff06 Fri Mar 8 13:46:43 2019 +0000 linux/amd64

When go mod why is asked to show a module that isn't a dependency, it prints a "main module does not need" line, but it succeeds regardless.

Perhaps it should be changed so that the exit status reflects whether the dependency was actually found or not.

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 11, 2019
@bcmills bcmills added this to the Go1.13 milestone Mar 11, 2019
@bcmills
Copy link
Contributor

bcmills commented Mar 11, 2019

See also #27900.

@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@mvdan
Copy link
Member

mvdan commented Feb 26, 2020

This would have made a CI script quite a lot simpler for me. The closest I can do right now is something like go mod why <arg> | grep 'does not need'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants