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

Method Var

flag.go:847–849  ·  view source on GitHub ↗

Var defines a flag with the specified name and usage string. The type and value of the flag are represented by the first argument, of type Value, which typically holds a user-defined implementation of Value. For instance, the caller could create a flag that turns a comma-separated string into a slic

(value Value, name string, usage string)

Source from the content-addressed store, hash-verified

845// of strings by giving the slice the methods of Value; in particular, Set would
846// decompose the comma-separated string into the slice.
847func (f *FlagSet) Var(value Value, name string, usage string) {
848 f.VarP(value, name, "", usage)
849}
850
851// VarPF is like VarP, but returns the flag created
852func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {

Callers 2

TestPrintDefaultsFunction · 0.95
CopyToGoFlagSetMethod · 0.80

Calls 1

VarPMethod · 0.95

Tested by 1

TestPrintDefaultsFunction · 0.76