aboutsummaryrefslogtreecommitdiff
path: root/src/archive
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2023-09-19 10:36:19 +0000
committerGopher Robot <gobot@golang.org>2023-09-22 16:22:42 +0000
commit9b883484a8c1c0fb556ac0d04cf24e54dff7eb47 (patch)
treef322f56ef71cb077a1559450d1c2b76f39991436 /src/archive
parentbf5d8c02bab68a8628956b953be8bf5928461fb6 (diff)
downloadgo-9b883484a8c1c0fb556ac0d04cf24e54dff7eb47.tar.gz
go-9b883484a8c1c0fb556ac0d04cf24e54dff7eb47.zip
all: clean unnecessary casts for test files
This is a follow up of CL 528696. Change-Id: I5b71eabedb12567c4b1b36f7182a3d2b0ed662a5 GitHub-Last-Rev: acaf3ac11c38042ad27b99e1c70a3c9f1a554a15 GitHub-Pull-Request: golang/go#62713 Reviewed-on: https://go-review.googlesource.com/c/go/+/529197 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/archive')
-rw-r--r--src/archive/zip/reader_test.go6
-rw-r--r--src/archive/zip/zip_test.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go
index a67c33598d..a1ae1c97cc 100644
--- a/src/archive/zip/reader_test.go
+++ b/src/archive/zip/reader_test.go
@@ -1186,7 +1186,7 @@ func TestIssue12449(t *testing.T) {
0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00,
}
// Read in the archive.
- _, err := NewReader(bytes.NewReader([]byte(data)), int64(len(data)))
+ _, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err != nil {
t.Errorf("Error reading the archive: %v", err)
}
@@ -1333,7 +1333,7 @@ func TestCVE202127919(t *testing.T) {
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x39, 0x00,
0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00,
}
- r, err := NewReader(bytes.NewReader([]byte(data)), int64(len(data)))
+ r, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err != ErrInsecurePath {
t.Fatalf("Error reading the archive: %v", err)
}
@@ -1559,7 +1559,7 @@ func TestCVE202141772(t *testing.T) {
0x00, 0x04, 0x00, 0x04, 0x00, 0x31, 0x01, 0x00,
0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
}
- r, err := NewReader(bytes.NewReader([]byte(data)), int64(len(data)))
+ r, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err != ErrInsecurePath {
t.Fatalf("Error reading the archive: %v", err)
}
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index f53d1b9913..e7661284e7 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -590,7 +590,7 @@ func testZip64(t testing.TB, size int64) *rleBuffer {
}
// read back zip file and check that we get to the end of it
- r, err := NewReader(buf, int64(buf.Size()))
+ r, err := NewReader(buf, buf.Size())
if err != nil {
t.Fatal("reader:", err)
}