]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: refer to the right package in a test
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 22 Sep 2021 13:59:42 +0000 (14:59 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 23 Sep 2021 21:59:30 +0000 (21:59 +0000)
The test checks that two packages aren't non-test dependencies.
There's a copy-paste typo, however.
When net/http is unexpectedly found as a dependendency,
we instead mention the other package in the error message.

Change-Id: I3232c6252255c839e08efa048f2232c192d0fb85
Reviewed-on: https://go-review.googlesource.com/c/go/+/351372
Trust: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/go/internal/imports/scan_test.go

index 2d245ee7872e73c706b15dcf6b2e1f9559248412..7e69c56513ac01a2acf0d5cd5d4372597abd96f0 100644 (file)
@@ -33,7 +33,7 @@ func TestScan(t *testing.T) {
                }
                if p == "net/http" {
                        // A test import but not an import
-                       t.Errorf("json reported as importing encoding/binary but does not")
+                       t.Errorf("json reported as importing net/http but does not")
                }
        }
        if !foundBase64 {