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

x/vuln: provide a user-friendly error when there are errors loading packages #59699

Closed
julieqiu opened this issue Apr 18, 2023 · 1 comment
Closed
Assignees
Labels
FrozenDueToAge vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Milestone

Comments

@julieqiu
Copy link
Member

julieqiu commented Apr 18, 2023

We should provide a more user-friendly error when a pattern isn't valid. For example, letting them know that the provided pattern is invalid, providing suggestions on how to do instead, and pointing users to https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns for information on how Go patterns work.

Current output:

~/code/vuln master ❯ go run ./cmd/govulncheck/ blah asldnasd                                                                                                06:10:09 PM
govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.

Using go1.20.3 and govulncheck@v0.0.0 with
vulnerability data from https://vuln.go.dev (last modified 2023-04-18 21:32:26 +0000 UTC).
Packages contain errors:
-: package blah is not in GOROOT (/Users/julieqiu/go/current/src/blah)
-: package asldnasd is not in GOROOT (/Users/julieqiu/go/current/src/asldnasd)

exit status 1

Code location:
https://github.com/golang/vuln/blob/ccb49889eaf7f00e6a3839d819b453eed08ee22e/internal/scan/errors.go#L59-L66

@julieqiu julieqiu added the vulncheck or vulndb Issues for the x/vuln or x/vulndb repo label Apr 18, 2023
@julieqiu julieqiu added this to the vuln/v0.2.0 milestone Apr 18, 2023
@julieqiu julieqiu self-assigned this Apr 19, 2023
@gopherbot
Copy link

Change https://go.dev/cl/486396 mentions this issue: internal/scan: improve error for bad package pattern

@golang golang locked and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Projects
None yet
Development

No branches or pull requests

2 participants