From 18d31e3e8bf47538c8a570268cd714d47bf01aef Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Jan 2026 15:39:04 -0800 Subject: [PATCH] compress/bzip2: use obscuretestdata.ReadFile to avoid creating temporary The temporary was not being deleted. Not creating it at all is better. Change-Id: Id9c5498a2f7d2f58770a09a2a76f4ab30943dd3d Reviewed-on: https://go-review.googlesource.com/c/go/+/740780 Reviewed-by: Dmitri Shuralyov Reviewed-by: Joseph Tsai Reviewed-by: Michael Pratt Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- src/compress/bzip2/bzip2_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compress/bzip2/bzip2_test.go b/src/compress/bzip2/bzip2_test.go index 13e2d3c1fa9..7473aac7a91 100644 --- a/src/compress/bzip2/bzip2_test.go +++ b/src/compress/bzip2/bzip2_test.go @@ -25,11 +25,11 @@ func mustDecodeHex(s string) []byte { func mustLoadFile(f string) []byte { if strings.HasSuffix(f, ".base64") { - tf, err := obscuretestdata.DecodeToTempFile(f) + b, err := obscuretestdata.ReadFile(f) if err != nil { - panic(fmt.Sprintf("obscuretestdata.DecodeToTempFile(%s): %v", f, err)) + panic(fmt.Sprintf("obscuretestdata.ReadFile(%s): %v", f, err)) } - f = tf + return b } b, err := os.ReadFile(f)