mirror of
https://github.com/golang/go.git
synced 2026-02-06 19:05:05 +03:00
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 <dmitshur@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
committed by
Gopher Robot
parent
7fd116f864
commit
18d31e3e8b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user