diff options
| author | Pascal Terjan <[email protected]> | 2026-01-09 14:07:08 +0000 |
|---|---|---|
| committer | Pascal Terjan <[email protected]> | 2026-01-10 11:37:33 +0000 |
| commit | 00153c6ac5d57e570f8378dedf321f34e373e4c3 (patch) | |
| tree | a56ccfe618e3f19c894dc87950272f152d7f17cd /flag.go | |
| parent | 6fcfbc9910e1af538fde31db820be7d1bec231e4 (diff) | |
Fix for Go 1.24
Go 1.24 no longer allows dynamic format string.
Diffstat (limited to 'flag.go')
| -rw-r--r-- | flag.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |
