MCPcopy
hub / github.com/spf13/pflag / Lookup

Method Lookup

flag.go:378–380  ·  view source on GitHub ↗

Lookup returns the Flag structure of the named flag, returning nil if none exists.

(name string)

Source from the content-addressed store, hash-verified

376
377// Lookup returns the Flag structure of the named flag, returning nil if none exists.
378func (f *FlagSet) Lookup(name string) *Flag {
379 return f.lookup(f.normalizeFlagName(name))
380}
381
382// ShorthandLookup returns the Flag structure of the short handed flag,
383// returning nil if none exists.

Callers 15

GetTextMethod · 0.95
TestAnnotationFunction · 0.95
TestPrintDefaultsFunction · 0.95
AddGoFlagMethod · 0.95
GetTimeMethod · 0.95
getFlagTypeMethod · 0.95
MarkDeprecatedMethod · 0.95
MarkHiddenMethod · 0.95
ChangedMethod · 0.95
AddFlagSetMethod · 0.95

Calls 2

lookupMethod · 0.95
normalizeFlagNameMethod · 0.95

Tested by 8

TestAnnotationFunction · 0.76
TestPrintDefaultsFunction · 0.76
TestToGoflagsFunction · 0.76
testParseFunction · 0.64
testParseAllFunction · 0.64