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>
This commit is contained in:
Jes Cok 2024-03-27 20:44:18 +08:00 committed by Gopher Robot
parent 7f35a0b461
commit 0cb1694084
2 changed files with 2 additions and 8 deletions

View file

@ -18,10 +18,7 @@ import (
type zeroSource struct{}
func (zeroSource) Read(b []byte) (n int, err error) {
for i := range b {
b[i] = 0
}
clear(b)
return len(b), nil
}

View file

@ -310,10 +310,7 @@ Dialing:
type zeroSource struct{}
func (zeroSource) Read(b []byte) (n int, err error) {
for i := range b {
b[i] = 0
}
clear(b)
return len(b), nil
}