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

Function String

string.go:73–75  ·  string.go::String

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

71// String defines a string flag with specified name, default value, and usage string.
72// The return value is the address of a string variable that stores the value of the flag.
73func String(name string, value string, usage string) *string {
74 return CommandLine.StringP(name, "", value, usage)
75}
76
77// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
78func StringP(name, shorthand string, value string, usage string) *string {

Callers 1

flag_test.goFile · 0.85

Calls 1

StringPMethod · 0.80

Tested by

no test coverage detected