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

Method SetOutput

flag.go:297–299  ·  view source on GitHub ↗

SetOutput sets the destination for usage and error messages. If output is nil, os.Stderr is used.

(output io.Writer)

Source from the content-addressed store, hash-verified

295// SetOutput sets the destination for usage and error messages.
296// If output is nil, os.Stderr is used.
297func (f *FlagSet) SetOutput(output io.Writer) {
298 f.output = output
299}
300
301// VisitAll visits the flags in lexicographical order or
302// in primordial order if f.SortFlags is false, calling fn for each.

Callers 15

TestBoolFuncCompatFunction · 0.95
setUpPFlagSetFunction · 0.95
setUpPFlagSet2Function · 0.95
TestShorthandFunction · 0.95
TestShorthandLookupFunction · 0.95
TestSetOutputFunction · 0.95
TestOutputFunction · 0.95
TestTerminationFunction · 0.95
TestHiddenFlagInUsageFunction · 0.95
TestPrintDefaultsFunction · 0.95
TestFuncCompatFunction · 0.95

Calls

no outgoing calls

Tested by 15

TestBoolFuncCompatFunction · 0.76
setUpPFlagSetFunction · 0.76
setUpPFlagSet2Function · 0.76
TestShorthandFunction · 0.76
TestShorthandLookupFunction · 0.76
TestSetOutputFunction · 0.76
TestOutputFunction · 0.76
TestTerminationFunction · 0.76
TestHiddenFlagInUsageFunction · 0.76
TestPrintDefaultsFunction · 0.76
TestFuncCompatFunction · 0.76