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

Method GetString

string.go:26–32  ·  view source on GitHub ↗

GetString return the string value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

24
25// GetString return the string value of a flag with the given name
26func (f *FlagSet) GetString(name string) (string, error) {
27 val, err := f.getFlagType(name, "string", stringConv)
28 if err != nil {
29 return "", err
30 }
31 return val.(string), nil
32}
33
34// StringVar defines a string flag with specified name, default value, and usage string.
35// The argument p points to a string variable in which to store the value of the flag.

Callers 2

TestGoflagsFunction · 0.95
testParseFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 2

TestGoflagsFunction · 0.76
testParseFunction · 0.64