aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorPascal Terjan <[email protected]>2026-01-09 14:07:08 +0000
committerPascal Terjan <[email protected]>2026-01-10 11:37:33 +0000
commit00153c6ac5d57e570f8378dedf321f34e373e4c3 (patch)
treea56ccfe618e3f19c894dc87950272f152d7f17cd /flag.go
parent6fcfbc9910e1af538fde31db820be7d1bec231e4 (diff)
Fix for Go 1.24
Go 1.24 no longer allows dynamic format string.
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/flag.go b/flag.go
index e9ca46e..1cb047a 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