Make ApplyWithError a public method on errorableFlag

Add to altsrc flags. Otherwise, flagSet() was bypassing altsrc's attempt
at shadowing.
This commit is contained in:
Jesse Szwedko
2016-11-13 16:15:05 -08:00
parent 8500a4cefd
commit d71794de19
3 changed files with 139 additions and 41 deletions

View File

@@ -232,6 +232,13 @@ def _write_altsrc_flag_types(outfile, types):
f.set = set
f.{name}Flag.Apply(set)
}}
// ApplyWithError saves the flagSet for later usage calls, then calls the
// wrapped {name}Flag.ApplyWithError
func (f *{name}Flag) ApplyWithError(set *flag.FlagSet) error {{
f.set = set
return f.{name}Flag.ApplyWithError(set)
}}
""".format(**typedef))