Skip to content

Commit

Permalink
Merge pull request #531 from damiannolan/damian/fix-word-repetition-i…
Browse files Browse the repository at this point in the history
…n-error

chore: fix duplicate word repetition in CreateChecksum error return
  • Loading branch information
webmaster128 authored Apr 2, 2024
2 parents f4d23d9 + 7237574 commit 5827a99
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 5827a99

Please sign in to comment.