From e55f5492ab5f7415e1600d91150df88869c56b90 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Mon, 11 Sep 2023 23:23:46 +0900 Subject: [PATCH] fix typos --- nip04/nip04.go | 2 +- nip04/nip04_test.go | 2 +- nson/nson_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nip04/nip04.go b/nip04/nip04.go index 99e642d..b2619aa 100644 --- a/nip04/nip04.go +++ b/nip04/nip04.go @@ -78,7 +78,7 @@ func Encrypt(message string, key []byte) (string, error) { func Decrypt(content string, key []byte) (string, error) { parts := strings.Split(content, "?iv=") if len(parts) < 2 { - return "", fmt.Errorf("error parsing encrypted message: no initilization vector") + return "", fmt.Errorf("error parsing encrypted message: no initialization vector") } ciphertext, err := base64.StdEncoding.DecodeString(parts[0]) diff --git a/nip04/nip04_test.go b/nip04/nip04_test.go index 9f5f973..199ff22 100644 --- a/nip04/nip04_test.go +++ b/nip04/nip04_test.go @@ -7,7 +7,7 @@ import ( func TestEncryptionAndDecryption(t *testing.T) { sharedSecret := make([]byte, 32) - message := "hello hellow" + message := "hello hello" ciphertext, err := Encrypt(message, sharedSecret) if err != nil { diff --git a/nson/nson_test.go b/nson/nson_test.go index 0915515..317b839 100644 --- a/nson/nson_test.go +++ b/nson/nson_test.go @@ -11,7 +11,7 @@ func TestBasicNsonParse(t *testing.T) { for _, jevt := range nsonTestEvents { evt := &nostr.Event{} if err := Unmarshal(jevt, evt); err != nil { - t.Fatalf("error unmarshaling nson: %s", err) + t.Fatalf("error unmarshalling nson: %s", err) } checkParsedCorrectly(t, evt, jevt) } @@ -21,7 +21,7 @@ func TestNsonPartialGet(t *testing.T) { for _, jevt := range nsonTestEvents { evt := &nostr.Event{} if err := Unmarshal(jevt, evt); err != nil { - t.Fatalf("error unmarshaling nson: %s", err) + t.Fatalf("error unmarshalling nson: %s", err) } wrapper := New(jevt) @@ -60,7 +60,7 @@ func TestNsonEncode(t *testing.T) { evt := &nostr.Event{} if err := Unmarshal(nevt, evt); err != nil { - t.Fatalf("error unmarshaling nson: %s", err) + t.Fatalf("error unmarshalling nson: %s", err) } checkParsedCorrectly(t, pevt, jevt) checkParsedCorrectly(t, evt, jevt) @@ -71,7 +71,7 @@ func checkParsedCorrectly(t *testing.T, evt *nostr.Event, jevt string) (isBad bo var canonical nostr.Event err := json.Unmarshal([]byte(jevt), &canonical) if err != nil { - t.Fatalf("error unmarshaling normal json: %s", err) + t.Fatalf("error unmarshalling normal json: %s", err) } if evt.ID != canonical.ID {