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

Method StringVar

string.go:36–38  ·  view source on GitHub ↗

StringVar defines a string flag with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the flag.

(p *string, name string, value string, usage string)

Source from the content-addressed store, hash-verified

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.
36func (f *FlagSet) StringVar(p *string, name string, value string, usage string) {
37 f.VarP(newStringValue(value, p), name, "", usage)
38}
39
40// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.
41func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) {

Callers 2

CopyToGoFlagSetMethod · 0.80
TestGoflagsFunction · 0.80

Calls 2

VarPMethod · 0.95
newStringValueFunction · 0.85

Tested by 1

TestGoflagsFunction · 0.64