Files
zeekayandClaude Opus 5 b939e760dc Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 18:49:12 -07:00

46 lines
1.0 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc All rights reserved.
// See the file LICENSE for licensing terms.
package color
import (
"fmt"
formatter "github.com/onsi/ginkgo/v2/formatter"
)
// Outputs to stdout.
//
// e.g.,
//
// Out("{{green}}{{bold}}hi there %q{{/}}", "aa")
// Out("{{magenta}}{{bold}}hi therea{{/}} {{cyan}}{{underline}}b{{/}}")
//
// ref.
// https://github.com/onsi/ginkgo/blob/v2.0.0/formatter/formatter.go#L52-L73
func Outf(format string, args ...any) {
s := formatter.F(format, args...)
fmt.Fprint(formatter.ColorableStdOut, s)
}
// Outputs to stderr.
func Errf(format string, args ...any) {
s := formatter.F(format, args...)
fmt.Fprint(formatter.ColorableStdErr, s)
}
func Greenf(format string, args ...any) {
f := fmt.Sprintf("{{green}}%s{{/}}", format)
Outf(f, args...)
}
func Redf(format string, args ...any) {
f := fmt.Sprintf("{{red}}%s{{/}}", format)
Outf(f, args...)
}
func Bluef(format string, args ...any) {
f := fmt.Sprintf("{{blue}}%s{{/}}", format)
Outf(f, args...)
}