aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-19 08:00:00 +0800
committerGravatar Runxi Yu2025-11-19 08:00:00 +0800
commitdbdbc5c7523957943b6c5fa17575936150762f93 (patch)
tree2211e7fb9783764556dba1413395d79b5923176e
parentRemove the broken compression benchmarking utility (diff)
signatureNo signature
Ignore some errors in the tests (actually from stdlib but linter complains)
-rw-r--r--internal/adler32/adler32_test.go6
-rw-r--r--internal/adler32/testhash.go16
2 files changed, 11 insertions, 11 deletions
diff --git a/internal/adler32/adler32_test.go b/internal/adler32/adler32_test.go
index e38e0ed8..12db7e50 100644
--- a/internal/adler32/adler32_test.go
+++ b/internal/adler32/adler32_test.go
@@ -100,7 +100,7 @@ func TestGoldenMarshal(t *testing.T) {
h := New()
h2 := New()
- io.WriteString(h, g.in[:len(g.in)/2])
+ _, _ = io.WriteString(h, g.in[:len(g.in)/2])
state, err := h.(encoding.BinaryMarshaler).MarshalBinary()
if err != nil {
@@ -130,8 +130,8 @@ func TestGoldenMarshal(t *testing.T) {
continue
}
- io.WriteString(h, g.in[len(g.in)/2:])
- io.WriteString(h2, g.in[len(g.in)/2:])
+ _, _ = io.WriteString(h, g.in[len(g.in)/2:])
+ _, _ = io.WriteString(h2, g.in[len(g.in)/2:])
if h.Sum32() != h2.Sum32() {
t.Errorf("checksum(%q) = 0x%x != marshaled (0x%x)", g.in, h.Sum32(), h2.Sum32())
diff --git a/internal/adler32/testhash.go b/internal/adler32/testhash.go
index cadf8748..4c31aae1 100644
--- a/internal/adler32/testhash.go
+++ b/internal/adler32/testhash.go
@@ -69,7 +69,7 @@ func TestHashWithoutClone(t *testing.T, mh MakeHash) {
emptyBuff := []byte("")
shortBuff := []byte("a")
longBuff := make([]byte, h.BlockSize()+1)
- rng.Read(longBuff)
+ _, _ = rng.Read(longBuff)
// Set of example strings to append digest to
prefixes := [][]byte{nil, emptyBuff, shortBuff, longBuff}
@@ -105,7 +105,7 @@ func TestHashWithoutClone(t *testing.T, mh MakeHash) {
emptySlice := []byte("")
shortSlice := []byte("a")
longSlice := make([]byte, h.BlockSize()+1)
- rng.Read(longSlice)
+ _, _ = rng.Read(longSlice)
// Set of example strings to append digest to
slices := [][]byte{emptySlice, shortSlice, longSlice}
@@ -123,7 +123,7 @@ func TestHashWithoutClone(t *testing.T, mh MakeHash) {
// Write to hash and then Reset it and see if Sum is same as emptySum
writeEx := make([]byte, h.BlockSize())
- rng.Read(writeEx)
+ _, _ = rng.Read(writeEx)
writeToHash(t, h, writeEx)
h.Reset()
resetSum := getSum(t, h, nil)
@@ -140,7 +140,7 @@ func TestHashWithoutClone(t *testing.T, mh MakeHash) {
rng := newRandReader(t)
msg := make([]byte, blockSize)
- rng.Read(msg)
+ _, _ = rng.Read(msg)
writeToHash(t, h, msg)
expectedDigest := getSum(t, h, nil) // Record control digest
@@ -151,8 +151,8 @@ func TestHashWithoutClone(t *testing.T, mh MakeHash) {
endOfPrefix, startOfSuffix := blockSize, blockSize*2
copy(buff[endOfPrefix:startOfSuffix], msg)
- rng.Read(buff[:endOfPrefix])
- rng.Read(buff[startOfSuffix:])
+ _, _ = rng.Read(buff[:endOfPrefix])
+ _, _ = rng.Read(buff[startOfSuffix:])
writeToHash(t, h, buff[endOfPrefix:startOfSuffix])
testDigest := getSum(t, h, nil)
@@ -168,8 +168,8 @@ func TestHashWithoutClone(t *testing.T, mh MakeHash) {
rng := newRandReader(t)
prefix, suffix := make([]byte, h.BlockSize()), make([]byte, h.BlockSize())
- rng.Read(prefix)
- rng.Read(suffix)
+ _, _ = rng.Read(prefix)
+ _, _ = rng.Read(suffix)
// Write prefix then suffix sequentially and record resulting hash
writeToHash(t, h, prefix)