compile tests again.

This commit is contained in:
fiatjaf 2025-05-23 07:52:19 -03:00
parent b5bd2aecf6
commit 0073c9bdf1
4 changed files with 4 additions and 5 deletions

View File

@ -17,10 +17,9 @@ import (
func call(t *testing.T, cmd string) string {
var output strings.Builder
stdout = func(a ...any) (int, error) {
stdout = func(a ...any) {
output.WriteString(fmt.Sprint(a...))
output.WriteString("\n")
return 0, nil
}
err := app.Run(t.Context(), strings.Split(cmd, " "))
require.NoError(t, err)

View File

@ -424,7 +424,7 @@ func askConfirmation(msg string) bool {
}
defer tty.Close()
fmt.Fprintf(os.Stderr, color.YellowString(msg))
log(color.YellowString(msg))
answer, err := tty.ReadString()
if err != nil {
return false

View File

@ -139,7 +139,7 @@ func askPassword(msg string, shouldAskAgain func(answer string) bool) (string, e
defer tty.Close()
for {
// print the prompt to stderr so it's visible to the user
fmt.Fprintf(os.Stderr, color.YellowString(msg))
log(color.YellowString(msg))
// read password from TTY with masking
password, err := tty.ReadPassword()

2
mcp.go
View File

@ -169,7 +169,7 @@ var mcpServer = &cli.Command{
l++
pm, _ := sdk.ParseMetadata(result.Event)
res.WriteString(fmt.Sprintf("\n\nResult %d\nUser name: \"%s\"\nPublic key: \"%s\"\nDescription: \"%s\"\n",
l, pm.ShortName, pm.PubKey.Hex(), pm.About))
l, pm.ShortName(), pm.PubKey.Hex(), pm.About))
if l >= int(limit) {
break