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 <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julieqiu@google.com>
diff --git a/cmd/govulncheck/errors.go b/cmd/govulncheck/errors.go
index d6506e0..9b1281b 100644
--- a/cmd/govulncheck/errors.go
+++ b/cmd/govulncheck/errors.go
@@ -28,21 +28,6 @@
 Otherwise, run go mod init to make your project a module.
 
 See https://go.dev/doc/modules/managing-dependencies for more information.`)
-
-	// errNoGoSum indicates that a go.sum file was not found in this module.
-	errNoGoSum = errors.New(`no go.sum file
-
-Your module is missing a go.sum file. Try running go mod tidy.
-
-See https://go.dev/doc/modules/managing-dependencies for more information.`)
-
-	// errNoModVersion indicates that govulncheck cannot access module version information.
-	errNoModVersion = errors.New(`no module version information
-
-This can happen when running govulncheck in GOPATH mode. govulncheck needs module
-versions to correctly identify vulnerabilities.
-
-See https://go.dev/doc/modules/managing-dependencies for more information.`)
 )
 
 // packageError contains errors from loading a set of packages.
diff --git a/cmd/govulncheck/main.go b/cmd/govulncheck/main.go
index 38825a5..96c4a2b 100644
--- a/cmd/govulncheck/main.go
+++ b/cmd/govulncheck/main.go
@@ -106,9 +106,6 @@
 			if !fileExists(filepath.Join(dir, "go.mod")) {
 				return errNoGoMod
 			}
-			if !fileExists(filepath.Join(dir, "go.sum")) {
-				return errNoGoSum
-			}
 			if isGoVersionMismatchError(err) {
 				return fmt.Errorf("%v\n\n%v", errGoVersionMismatch, err)
 			}
diff --git a/cmd/govulncheck/testdata/modules/nogosum/go.mod b/cmd/govulncheck/testdata/modules/nogosum/go.mod
deleted file mode 100644
index 6312ce2..0000000
--- a/cmd/govulncheck/testdata/modules/nogosum/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module vuln
-
-go 1.19
diff --git a/cmd/govulncheck/testdata/modules/nogosum/vuln.go b/cmd/govulncheck/testdata/modules/nogosum/vuln.go
deleted file mode 100644
index e479a37..0000000
--- a/cmd/govulncheck/testdata/modules/nogosum/vuln.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package main
-
-import (
-	"fmt"
-
-	"golang.org/x/text/language"
-)
-
-func main() {
-	fmt.Println("hello")
-	language.Parse("")
-}
diff --git a/cmd/govulncheck/testdata/nogosum.ct b/cmd/govulncheck/testdata/nogosum.ct
deleted file mode 100644
index eaeb61e..0000000
--- a/cmd/govulncheck/testdata/nogosum.ct
+++ /dev/null
@@ -1,11 +0,0 @@
-# Test of missing go.sum error message.
-
-$ govulncheck -dir ${moddir}/nogosum . --> FAIL 1
-govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.
-
-Scanning for dependencies with known vulnerabilities...
-govulncheck: no go.sum file
-
-Your module is missing a go.sum file. Try running go mod tidy.
-
-See https://go.dev/doc/modules/managing-dependencies for more information.