@@ -24,40 +24,29 @@ var (
2424// IntSlice looks up the value of a local IntSliceFlag, returns
2525// nil if not found
2626func (cmd * Command ) IntSlice (name string ) []int {
27- return getIntSlice [int ](cmd , name )
27+ return getNumberSlice [int ](cmd , name )
2828}
2929
3030// Int8Slice looks up the value of a local Int8SliceFlag, returns
3131// nil if not found
3232func (cmd * Command ) Int8Slice (name string ) []int8 {
33- return getIntSlice [int8 ](cmd , name )
33+ return getNumberSlice [int8 ](cmd , name )
3434}
3535
3636// Int16Slice looks up the value of a local Int16SliceFlag, returns
3737// nil if not found
3838func (cmd * Command ) Int16Slice (name string ) []int16 {
39- return getIntSlice [int16 ](cmd , name )
39+ return getNumberSlice [int16 ](cmd , name )
4040}
4141
4242// Int32Slice looks up the value of a local Int32SliceFlag, returns
4343// nil if not found
4444func (cmd * Command ) Int32Slice (name string ) []int32 {
45- return getIntSlice [int32 ](cmd , name )
45+ return getNumberSlice [int32 ](cmd , name )
4646}
4747
4848// Int64Slice looks up the value of a local Int64SliceFlag, returns
4949// nil if not found
5050func (cmd * Command ) Int64Slice (name string ) []int64 {
51- return getIntSlice [int64 ](cmd , name )
52- }
53-
54- func getIntSlice [T int | int8 | int16 | int32 | int64 ](cmd * Command , name string ) []T {
55- if v , ok := cmd .Value (name ).([]T ); ok {
56- tracef ("int slice available for flag name %[1]q with value=%[2]v (cmd=%[3]q)" , name , v , cmd .Name )
57-
58- return v
59- }
60-
61- tracef ("int slice NOT available for flag name %[1]q (cmd=%[2]q)" , name , cmd .Name )
62- return nil
51+ return getNumberSlice [int64 ](cmd , name )
6352}
0 commit comments