Open plungingChode opened 1 year ago
The example code should be completed regarding how the "flags" variable is created.
The FlagSet.SortFlags
field is indeed exported. CommandLine
is a convenient FlagSet
exposed by the package.
Documentation bug, I'd say.
The
SortFlags
option mentioned in the README is not actually exported. https://github.com/spf13/pflag/blob/d5e0c0615acee7028e1e2740a11102313be88de1/README.md?plain=1#L257 InsteadCommandLine.SortFlags
is available.