aboutsummaryrefslogtreecommitdiff
path: root/src/archive
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2024-03-27 20:44:18 +0800
committerGopher Robot <gobot@golang.org>2024-03-27 18:23:49 +0000
commitd4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b (patch)
treeeb6ae70562c931c2273853b8ac158e4b87c7b1ae /src/archive
parent979b34b37c7af73742550ff128d162d0eb2a5f2d (diff)
downloadgo-d4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b.tar.gz
go-d4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b.zip
all: make use of builtin clear
Change-Id: I1df0685c75fc1044ba46003a69ecc7dfc53bbc2b Reviewed-on: https://go-review.googlesource.com/c/go/+/574675 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/archive')
-rw-r--r--src/archive/zip/reader_test.go4
-rw-r--r--src/archive/zip/zip_test.go4
2 files changed, 2 insertions, 6 deletions
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go
index 631515cf5d..9f651da530 100644
--- a/src/archive/zip/reader_test.go
+++ b/src/archive/zip/reader_test.go
@@ -904,9 +904,7 @@ func returnRecursiveZip() (r io.ReaderAt, size int64) {
// type zeros struct{}
//
// func (zeros) Read(b []byte) (int, error) {
-// for i := range b {
-// b[i] = 0
-// }
+// clear(b)
// return len(b), nil
// }
//
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index e7661284e7..5425f22033 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -814,8 +814,6 @@ func TestSuffixSaver(t *testing.T) {
type zeros struct{}
func (zeros) Read(p []byte) (int, error) {
- for i := range p {
- p[i] = 0
- }
+ clear(p)
return len(p), nil
}