From 61ab03366b4da5af53ab00c800733f458c512579 Mon Sep 17 00:00:00 2001 From: Mos Roshanavand Date: Mon, 26 Jun 2023 02:52:01 +0200 Subject: [PATCH] Generate a clearer panic message --- flag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flag.go b/flag.go index 7c058de3..1ee53430 100644 --- a/flag.go +++ b/flag.go @@ -876,7 +876,7 @@ func (f *FlagSet) AddFlag(flag *Flag) { c := flag.Shorthand[0] 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) + msg := fmt.Sprintf("unable to define %q shorthand for %q flag: it's already used for %q flag", c, flag.Name, used.Name) fmt.Fprintf(f.Output(), msg) panic(msg) }