From 00153c6ac5d57e570f8378dedf321f34e373e4c3 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 9 Jan 2026 14:07:08 +0000 Subject: [PATCH] Fix for Go 1.24 Go 1.24 no longer allows dynamic format string. --- flag.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flag.go b/flag.go index e9ca46e2..1cb047a9 100644 --- a/flag.go +++ b/flag.go @@ -388,7 +388,7 @@ func (f *FlagSet) ShorthandLookup(name string) *Flag { } if len(name) > 1 { msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) - fmt.Fprintf(f.Output(), msg) + fmt.Fprint(f.Output(), msg) panic(msg) } c := name[0] @@ -893,7 +893,7 @@ func (f *FlagSet) AddFlag(flag *Flag) { } if len(flag.Shorthand) > 1 { msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand) - fmt.Fprintf(f.Output(), msg) + fmt.Fprint(f.Output(), msg) panic(msg) } if f.shorthands == nil { @@ -903,7 +903,7 @@ func (f *FlagSet) AddFlag(flag *Flag) { used, alreadyThere := f.shorthands[c] if alreadyThere { msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name) - fmt.Fprintf(f.Output(), msg) + fmt.Fprint(f.Output(), msg) panic(msg) } f.shorthands[c] = flag