use color.Output and color.Error instead of os.Stdout and os.Stderr in some places.

This commit is contained in:
fiatjaf 2025-05-03 21:45:28 -03:00
parent 02f22a8c2f
commit 9055f98f66
3 changed files with 3 additions and 3 deletions

View File

@ -130,7 +130,7 @@ var blossomCmd = &cli.Command{
hasError = true
continue
}
os.Stdout.Write(data)
stdout(data)
}
}

View File

@ -40,7 +40,7 @@ const (
var (
log = func(msg string, args ...any) { fmt.Fprintf(color.Error, msg, args...) }
logverbose = func(msg string, args ...any) {} // by default do nothing
stdout = fmt.Println
stdout = func(args ...any) { fmt.Fprintln(color.Output, args...) }
)
func isPiped() bool {

View File

@ -60,7 +60,7 @@ var app = &cli.Command{
if q >= 1 {
log = func(msg string, args ...any) {}
if q >= 2 {
stdout = func(_ ...any) (int, error) { return 0, nil }
stdout = func(_ ...any) {}
}
}
return nil