From 7237574963770834cc0689423523b66a532b681c Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 2 Apr 2024 10:27:10 +0200 Subject: [PATCH] chore: fix duplicate word repetition in CreateChecksum error return --- lib.go | 2 +- lib_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.go b/lib.go index 1704ff0eb..161f36f4c 100644 --- a/lib.go +++ b/lib.go @@ -52,7 +52,7 @@ func CreateChecksum(wasm []byte) (Checksum, error) { // magic number for Wasm is "\0asm" // See https://webassembly.github.io/spec/core/binary/modules.html#binary-module if !bytes.Equal(wasm[:4], []byte("\x00\x61\x73\x6D")) { - return Checksum{}, fmt.Errorf("Wasm bytes do not not start with Wasm magic number") + return Checksum{}, fmt.Errorf("Wasm bytes do not start with Wasm magic number") } hash := sha256.Sum256(wasm) return Checksum(hash[:]), nil diff --git a/lib_test.go b/lib_test.go index 3cc5cf916..35094e7df 100644 --- a/lib_test.go +++ b/lib_test.go @@ -29,5 +29,5 @@ func TestCreateChecksum(t *testing.T) { // Text file fails _, err = CreateChecksum([]byte("Hello world")) - require.ErrorContains(t, err, "do not not start with Wasm magic number") + require.ErrorContains(t, err, "do not start with Wasm magic number") }