File: 0020-internal-imports-adjust-TestStdlibSelfImports-pkg.patch

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (54 lines) | stat: -rw-r--r-- 1,947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Daniel McCarney <daniel@binaryparadox.net>
Date: Mon, 18 Nov 2024 09:58:32 -0500
Subject: internal/imports: adjust TestStdlibSelfImports pkg

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>
Forwarded: not-needed
Origin: upstream
---
 internal/imports/fix_test.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/internal/imports/fix_test.go b/internal/imports/fix_test.go
index 0571c6a..4a70661 100644
--- a/internal/imports/fix_test.go
+++ b/internal/imports/fix_test.go
@@ -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{
@@ -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)
 		}