From 0a7f44307d82615b77e644d91bd74bd925085303 Mon Sep 17 00:00:00 2001 From: 1l0 Date: Sun, 15 Jun 2025 08:23:26 +0900 Subject: [PATCH] nip44: use fmt.Errorf correctly --- nip44/nip44.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nip44/nip44.go b/nip44/nip44.go index 253dab2..f35e35f 100644 --- a/nip44/nip44.go +++ b/nip44/nip44.go @@ -96,7 +96,7 @@ func Encrypt(plaintext string, conversationKey [32]byte, applyOptions ...func(op func Decrypt(b64ciphertextWrapped string, conversationKey [32]byte) (string, error) { cLen := len(b64ciphertextWrapped) if cLen < 132 || cLen > 87472 { - return "", fmt.Errorf(fmt.Sprintf("invalid payload length: %d", cLen)) + return "", fmt.Errorf("invalid payload length: %d", cLen) } if b64ciphertextWrapped[0:1] == "#" { return "", fmt.Errorf("unknown version") @@ -108,12 +108,12 @@ func Decrypt(b64ciphertextWrapped string, conversationKey [32]byte) (string, err } if decoded[0] != version { - return "", fmt.Errorf(fmt.Sprintf("unknown version %d", decoded[0])) + return "", fmt.Errorf("unknown version %d", decoded[0]) } dLen := len(decoded) if dLen < 99 || dLen > 65603 { - return "", fmt.Errorf(fmt.Sprintf("invalid data length: %d", dLen)) + return "", fmt.Errorf("invalid data length: %d", dLen) } var nonce [32]byte