metropolis/pkg/gpt: call Hash.Sum with nil instead of empty byte slice
Change-Id: I90baf8c86a366964c5fc0967ea38cb40b5bc5240
Reviewed-on: https://review.monogon.dev/c/monogon/+/2995
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/pkg/gpt/gpt_test.go b/metropolis/pkg/gpt/gpt_test.go
index 42b9df5..3f25db9 100644
--- a/metropolis/pkg/gpt/gpt_test.go
+++ b/metropolis/pkg/gpt/gpt_test.go
@@ -130,7 +130,7 @@
if _, err := io.CopyBuffer(rewrittenHash, sr2, make([]byte, d.OptimalBlockSize())); err != nil {
panic(err)
}
- if !bytes.Equal(originalHash.Sum([]byte{}), rewrittenHash.Sum([]byte{})) {
- t.Errorf("Write/Read/Write test was not reproducible: %x != %x", originalHash.Sum([]byte{}), rewrittenHash.Sum([]byte{}))
+ if !bytes.Equal(originalHash.Sum(nil), rewrittenHash.Sum(nil)) {
+ t.Errorf("Write/Read/Write test was not reproducible: %x != %x", originalHash.Sum(nil), rewrittenHash.Sum(nil))
}
}