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

cmd/go: go mod why exit status should be non-zero if module is not used #30721

rogpeppe opened this issue Mar 10, 2019 · 2 comments
Labels
Milestone

Comments

@rogpeppe
Copy link
Contributor

@rogpeppe 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.

@rogpeppe rogpeppe added the modules label Mar 10, 2019
@bcmills bcmills added the NeedsFix label Mar 11, 2019
@bcmills bcmills added this to the Go1.13 milestone Mar 11, 2019
@bcmills
Copy link
Member

@bcmills 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 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.