notary/internal/sumweb: change GONOVERIFY to GONOSUMDB

"No verify" is a bit too vague. It sounds like maybe it would stop
"go mod verify" from applying as well. GONOSUMDB is more specific.

The checksum database server key will probably be GOSUMDB,
completing the analogy

	GOPROXY : GONOPROXY :: GOSUMDB : GONOSUMDB

Change-Id: I17ca7f21faed16e86e8b376f54bdef888db3835a
Reviewed-on: https://go-review.googlesource.com/c/exp/+/173539
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
diff --git a/notary/gosumcheck/main.go b/notary/gosumcheck/main.go
index f6accb1..37d63d1 100644
--- a/notary/gosumcheck/main.go
+++ b/notary/gosumcheck/main.go
@@ -72,17 +72,17 @@
 	conn := sumweb.NewConn(new(client))
 
 	// Look in environment explicitly, so that if 'go env' is old and
-	// doesn't know about GONOVERIFY, we at least get anything
+	// doesn't know about GONOSUMDB, we at least get anything
 	// set in the environment.
-	env := os.Getenv("GONOVERIFY")
+	env := os.Getenv("GONOSUMDB")
 	if env == "" {
-		out, err := exec.Command("go", "env", "GONOVERIFY").CombinedOutput()
+		out, err := exec.Command("go", "env", "GONOSUMDB").CombinedOutput()
 		if err != nil {
-			log.Fatalf("go env GONOVERIFY: %v\n%s", err, out)
+			log.Fatalf("go env GONOSUMDB: %v\n%s", err, out)
 		}
 		env = strings.TrimSpace(string(out))
 	}
-	conn.SetGONOVERIFY(env)
+	conn.SetGONOSUMDB(env)
 
 	for _, arg := range flag.Args() {
 		data, err := ioutil.ReadFile(arg)
@@ -115,7 +115,7 @@
 
 			dbLines, err := conn.Lookup(f[0], f[1])
 			if err != nil {
-				if err == sumweb.ErrGONOVERIFY {
+				if err == sumweb.ErrGONOSUMDB {
 					errs[i] = fmt.Sprintf("%s@%s: %v", f[0], f[1], err)
 				} else {
 					// Otherwise Lookup properly adds the prefix itself.
diff --git a/notary/gosumcheck/test.bash b/notary/gosumcheck/test.bash
index 4557b03..f77e01b 100755
--- a/notary/gosumcheck/test.bash
+++ b/notary/gosumcheck/test.bash
@@ -2,6 +2,6 @@
 
 set -e
 go build -o gosumcheck.exe
-export GONOVERIFY=*/text # rsc.io/text but not golang.org/x/text
+export GONOSUMDB=*/text # rsc.io/text but not golang.org/x/text
 ./gosumcheck.exe "$@" -v test.sum
 rm -f ./gosumcheck.exe
diff --git a/notary/internal/sumweb/client.go b/notary/internal/sumweb/client.go
index cf6891f..b42209c 100644
--- a/notary/internal/sumweb/client.go
+++ b/notary/internal/sumweb/client.go
@@ -161,11 +161,11 @@
 	c.tileHeight = height
 }
 
-// SetGONOVERIFY sets the list of comma-separated GONOVERIFY patterns for the Conn.
+// SetGONOSUMDB sets the list of comma-separated GONOSUMDB patterns for the Conn.
 // For any module path matching one of the patterns,
-// Lookup will return ErrGONOVERIFY.
-// Any call to SetGONOVERIFY must happen before the first call to Lookup.
-func (c *Conn) SetGONOVERIFY(list string) {
+// Lookup will return ErrGONOSUMDB.
+// Any call to SetGONOSUMDB must happen before the first call to Lookup.
+func (c *Conn) SetGONOSUMDB(list string) {
 	c.noverify = nil
 	for _, glob := range strings.Split(list, ",") {
 		if glob != "" {
@@ -174,10 +174,10 @@
 	}
 }
 
-// ErrGONOVERIFY is returned by Lookup for paths that match
-// a pattern listed in the GONOVERIFY list (set by SetGONOVERIFY,
+// ErrGONOSUMDB is returned by Lookup for paths that match
+// a pattern listed in the GONOSUMDB list (set by SetGONOSUMDB,
 // usually from the environment variable).
-var ErrGONOVERIFY = errors.New("skipped (listed in GONOVERIFY)")
+var ErrGONOSUMDB = errors.New("skipped (listed in GONOSUMDB)")
 
 func (c *Conn) skip(target string) bool {
 	for _, glob := range c.noverify {
@@ -211,7 +211,7 @@
 // Lookup returns the go.sum lines for the given module path and version.
 func (c *Conn) Lookup(path, vers string) (lines []string, err error) {
 	if c.skip(path) {
-		return nil, ErrGONOVERIFY
+		return nil, ErrGONOSUMDB
 	}
 
 	defer func() {
diff --git a/notary/internal/sumweb/client_test.go b/notary/internal/sumweb/client_test.go
index e500ef4..ccbea68 100644
--- a/notary/internal/sumweb/client_test.go
+++ b/notary/internal/sumweb/client_test.go
@@ -154,11 +154,11 @@
 	}
 }
 
-func TestConnGONOVERIFY(t *testing.T) {
+func TestConnGONOSUMDB(t *testing.T) {
 	tc := newTestClient(t)
 	tc.conn.Lookup("rsc.io/sampler", "v1.3.0") // initialize before we turn off network
 	tc.getOK = false
-	tc.conn.SetGONOVERIFY("p,*/q")
+	tc.conn.SetGONOSUMDB("p,*/q")
 
 	ok := []string{
 		"abc",
@@ -176,14 +176,14 @@
 
 	for _, path := range ok {
 		_, err := tc.conn.Lookup(path, "v1.0.0")
-		if err == ErrGONOVERIFY {
-			t.Errorf("Lookup(%q): ErrGONOVERIFY, wanted failed actual lookup", path)
+		if err == ErrGONOSUMDB {
+			t.Errorf("Lookup(%q): ErrGONOSUMDB, wanted failed actual lookup", path)
 		}
 	}
 	for _, path := range skip {
 		_, err := tc.conn.Lookup(path, "v1.0.0")
-		if err != ErrGONOVERIFY {
-			t.Errorf("Lookup(%q): %v, wanted ErrGONOVERIFY", path, err)
+		if err != ErrGONOSUMDB {
+			t.Errorf("Lookup(%q): %v, wanted ErrGONOSUMDB", path, err)
 		}
 	}
 }