all: clean up minor issues found by staticcheck

Use bytes.Equal instead of comparing bytes.Compare results to zero,
avoid Yoda conditions, drop a redundant zero slice capacity, use
strings.ReplaceAll, build acme error strings with a strings.Builder,
and lowercase an error string in ocsp. No behavior changes.

Change-Id: I5d2b3fa5c241adc75e61be0f2d2d7af1eb9e8d66
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/803200
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Brad Fitzpatrick
2026-07-21 14:30:59 -07:00
committed by Gopher Robot
parent ff03dafdb0
commit f2135b814c
9 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ func TestBufferReadwrite(t *testing.T) {
b.write(alphabet[5:15])
r, _ = b.Read(make([]byte, 10))
r2, _ := b.Read(make([]byte, 10))
if r != 10 || r2 != 5 || 15 != r+r2 {
if r != 10 || r2 != 5 || r+r2 != 15 {
t.Fatal("Expected written == read == 15")
}
}