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

Interface SliceValue

flag.go:219–226  ·  flag.go::SliceValue

SliceValue is a secondary interface to all flags which hold a list of values. This allows full control over the value of list flags, and avoids complicated marshalling and unmarshalling to csv.

Source from the content-addressed store, hash-verified

217// of values. This allows full control over the value of list flags,
218// and avoids complicated marshalling and unmarshalling to csv.
219type SliceValue interface {
220 // Append adds the specified value to the end of the flag value list.
221 Append(string) error
222 // Replace will fully overwrite any data currently in the flag value list.
223 Replace([]string) error
224 // GetSlice returns the flag value list as an array of strings.
225 GetSlice() []string
226}
227
228// sortFlags returns the flags as a slice in lexicographical sorted order.
229func sortFlags(flags map[NormalizedName]*Flag) []*Flag {

Callers 8

TestDSAsSliceValueFunction · 0.65
SetMethod · 0.65
TestIPSAsSliceValueFunction · 0.65
TestUISAsSliceValueFunction · 0.65
TestI64SAsSliceValueFunction · 0.65
replaceSeparatorsFunction · 0.65
SetMethod · 0.65
TestF32SAsSliceValueFunction · 0.65

Implementers 11

durationSliceValueduration_slice.go
stringArrayValuestring_array.go
float64SliceValuefloat64_slice.go
int32SliceValueint32_slice.go
intSliceValueint_slice.go
stringSliceValuestring_slice.go
int64SliceValueint64_slice.go
ipSliceValueip_slice.go
float32SliceValuefloat32_slice.go
uintSliceValueuint_slice.go
boolSliceValuebool_slice.go

Calls

no outgoing calls

Tested by

no test coverage detected