Skip to content

Commit

Permalink
chore: fix duplicate word repetition in CreateChecksum error return
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Apr 2, 2024
1 parent f4d23d9 commit 7237574
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 7237574

Please sign in to comment.