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

Function StringVar

string.go:47–49  ·  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

45// StringVar defines a string flag with specified name, default value, and usage string.
46// The argument p points to a string variable in which to store the value of the flag.
47func StringVar(p *string, name string, value string, usage string) {
48 CommandLine.VarP(newStringValue(value, p), name, "", usage)
49}
50
51// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.
52func StringVarP(p *string, name, shorthand string, value string, usage string) {

Callers

nothing calls this directly

Calls 2

newStringValueFunction · 0.85
VarPMethod · 0.80

Tested by

no test coverage detected