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

Method String

string.go:58–62  ·  view source on GitHub ↗

String defines a string flag with specified name, default value, and usage string. The return value is the address of a string variable that stores the value of the flag.

(name string, value string, usage string)

Source from the content-addressed store, hash-verified

56// String defines a string flag with specified name, default value, and usage string.
57// The return value is the address of a string variable that stores the value of the flag.
58func (f *FlagSet) String(name string, value string, usage string) *string {
59 p := new(string)
60 f.StringVarP(p, name, "", value, usage)
61 return p
62}
63
64// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
65func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {

Callers 4

setUpPFlagSet2Function · 0.95
TestAddFlagSetFunction · 0.95
TestPrintDefaultsFunction · 0.95
TestToGoflagsFunction · 0.95

Calls 1

StringVarPMethod · 0.95

Tested by 4

setUpPFlagSet2Function · 0.76
TestAddFlagSetFunction · 0.76
TestPrintDefaultsFunction · 0.76
TestToGoflagsFunction · 0.76