Skip to content

Commit 9a45c6b

Browse files
committed
cmd/govulncheck: delete no-go-sum error
This error is not necessary as the original error message "missing go.sum entry ..." is clear enough. Otherwise, the current classification of this error was wrong and would mask other important errors. Also cleans up other currently unused errors. Fixes golang/go#57013 Change-Id: If67ea4423b81bf35103c67d10c7e1eb291470fb3 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/456135 Run-TryBot: Zvonimir Pavlinovic <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Julie Qiu <[email protected]>
1 parent d4be6ae commit 9a45c6b

File tree

5 files changed

+0
-44
lines changed

5 files changed

+0
-44
lines changed

cmd/govulncheck/errors.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ govulncheck with the current Go version.`)
2727
govulncheck only works Go with modules. Try navigating to your module directory.
2828
Otherwise, run go mod init to make your project a module.
2929
30-
See https://go.dev/doc/modules/managing-dependencies for more information.`)
31-
32-
// errNoGoSum indicates that a go.sum file was not found in this module.
33-
errNoGoSum = errors.New(`no go.sum file
34-
35-
Your module is missing a go.sum file. Try running go mod tidy.
36-
37-
See https://go.dev/doc/modules/managing-dependencies for more information.`)
38-
39-
// errNoModVersion indicates that govulncheck cannot access module version information.
40-
errNoModVersion = errors.New(`no module version information
41-
42-
This can happen when running govulncheck in GOPATH mode. govulncheck needs module
43-
versions to correctly identify vulnerabilities.
44-
4530
See https://go.dev/doc/modules/managing-dependencies for more information.`)
4631
)
4732

cmd/govulncheck/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ func doGovulncheck(patterns []string, sourceAnalysis bool) error {
106106
if !fileExists(filepath.Join(dir, "go.mod")) {
107107
return errNoGoMod
108108
}
109-
if !fileExists(filepath.Join(dir, "go.sum")) {
110-
return errNoGoSum
111-
}
112109
if isGoVersionMismatchError(err) {
113110
return fmt.Errorf("%v\n\n%v", errGoVersionMismatch, err)
114111
}

cmd/govulncheck/testdata/modules/nogosum/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

cmd/govulncheck/testdata/modules/nogosum/vuln.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmd/govulncheck/testdata/nogosum.ct

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)