diff --git a/encrypt_decrypt.go b/encrypt_decrypt.go index 8ef39e7..e517fdf 100644 --- a/encrypt_decrypt.go +++ b/encrypt_decrypt.go @@ -45,7 +45,7 @@ var encrypt = &cli.Command{ if err != nil { return err } - fmt.Println(ciphertext) + stdout(ciphertext) } else { ss, err := nip04.ComputeSharedSecret(target, sec) if err != nil { @@ -55,7 +55,7 @@ var encrypt = &cli.Command{ if err != nil { return fmt.Errorf("failed to encrypt as nip04: %w", err) } - fmt.Println(ciphertext) + stdout(ciphertext) } } else { kr, err := gatherKeyerFromArguments(ctx, c) @@ -67,7 +67,7 @@ var encrypt = &cli.Command{ if err != nil { return fmt.Errorf("failed to encrypt: %w", err) } - fmt.Println(res) + stdout(res) } return nil @@ -110,7 +110,7 @@ var decrypt = &cli.Command{ if err != nil { return err } - fmt.Println(plaintext) + stdout(plaintext) } else { ss, err := nip04.ComputeSharedSecret(source, sec) if err != nil { @@ -120,7 +120,7 @@ var decrypt = &cli.Command{ if err != nil { return fmt.Errorf("failed to encrypt as nip04: %w", err) } - fmt.Println(plaintext) + stdout(plaintext) } } else { kr, err := gatherKeyerFromArguments(ctx, c) @@ -132,7 +132,7 @@ var decrypt = &cli.Command{ if err != nil { return fmt.Errorf("failed to encrypt: %w", err) } - fmt.Println(res) + stdout(res) } return nil diff --git a/key.go b/key.go index 826cb7f..df5ef2a 100644 --- a/key.go +++ b/key.go @@ -252,13 +252,13 @@ However, if the intent is to check if two existing Nostr pubkeys match a given c } res, _ := json.MarshalIndent(result, "", " ") - fmt.Println(string(res)) + stdout(string(res)) return nil }, } -func getSecretKeysFromStdinLinesOrSlice(ctx context.Context, c *cli.Command, keys []string) chan string { +func getSecretKeysFromStdinLinesOrSlice(ctx context.Context, _ *cli.Command, keys []string) chan string { ch := make(chan string) go func() { for sec := range getStdinLinesOrArgumentsFromSlice(keys) {