Skip to content

Commit

Permalink
internal/imports: adjust TestStdlibSelfImports pkg
Browse files Browse the repository at this point in the history
This commit switches the test to use crypto/rc4 instead of crypto/ecdsa.

The crypto.ecdsa package will soon be imported into the FIPS module,
producing an unexpected import of crypto/internal/fips/ecdsa by the
pre-existing test.

Instead, use the rc4 stdlib package. This won't be under consideration
for FIPS.

Change-Id: I87bcaa04efe1138aa80bf7ce88f0df74469daf4d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/629115
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
  • Loading branch information
cpu authored and gopherbot committed Nov 18, 2024
1 parent b8ff201 commit 52eb446
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/imports/fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1652,9 +1652,9 @@ var _ = bytes.Buffer
}

func TestStdlibSelfImports(t *testing.T) {
const input = `package ecdsa
const input = `package rc4
var _ = ecdsa.GenerateKey
var _ = rc4.NewCipher
`

testConfig{
Expand All @@ -1663,7 +1663,7 @@ var _ = ecdsa.GenerateKey
Files: fm{"x.go": "package x"},
},
}.test(t, func(t *goimportTest) {
got, err := t.processNonModule(filepath.Join(t.goroot, "src/crypto/ecdsa/foo.go"), []byte(input), nil)
got, err := t.processNonModule(filepath.Join(t.goroot, "src/crypto/rc4/foo.go"), []byte(input), nil)
if err != nil {
t.Fatalf("Process() = %v", err)
}
Expand Down

0 comments on commit 52eb446

Please sign in to comment.