@@ -2607,7 +2607,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) {
26072607}
26082608
26092609func TestTimestampFlagApply_ShortenedLayouts (t * testing.T ) {
2610- now := time .Now ().In ( time . UTC )
2610+ now := time .Now ().UTC ( )
26112611
26122612 shortenedLayoutsPrecisions := map [string ]time.Duration {
26132613 time .Kitchen : time .Minute ,
@@ -2726,11 +2726,23 @@ func TestFlagDefaultValue(t *testing.T) {
27262726 expect : `--flag string [ --flag string ] (default: "default1", "default2")` ,
27272727 },
27282728 {
2729- name : "float64Slice " ,
2729+ name : "floatSlice " ,
27302730 flag : & FloatSliceFlag {Name : "flag" , Value : []float64 {1.1 , 2.2 }},
27312731 toParse : []string {"--flag" , "13.3" },
27322732 expect : `--flag float [ --flag float ] (default: 1.1, 2.2)` ,
27332733 },
2734+ {
2735+ name : "float32Slice" ,
2736+ flag : & Float32SliceFlag {Name : "flag" , Value : []float32 {1.1 , 2.2 }},
2737+ toParse : []string {"--flag" , "13.3" },
2738+ expect : `--flag float [ --flag float ] (default: 1.1, 2.2)` ,
2739+ },
2740+ {
2741+ name : "float64Slice" ,
2742+ flag : & Float64SliceFlag {Name : "flag" , Value : []float64 {1.1 , 2.2 }},
2743+ toParse : []string {"--flag" , "13.3" },
2744+ expect : `--flag float [ --flag float ] (default: 1.1, 2.2)` ,
2745+ },
27342746 {
27352747 name : "intSlice" ,
27362748 flag : & Int64SliceFlag {Name : "flag" , Value : []int64 {1 , 2 }},
@@ -3243,11 +3255,15 @@ func TestExtFlag(t *testing.T) {
32433255
32443256func TestSliceValuesNil (t * testing.T ) {
32453257 assert .Equal (t , []float64 (nil ), NewFloatSlice ().Value ())
3258+ assert .Equal (t , []float32 (nil ), NewFloat32Slice ().Value ())
3259+ assert .Equal (t , []float64 (nil ), NewFloat64Slice ().Value ())
32463260 assert .Equal (t , []int64 (nil ), NewInt64Slice ().Value ())
32473261 assert .Equal (t , []uint64 (nil ), NewUint64Slice ().Value ())
32483262 assert .Equal (t , []string (nil ), NewStringSlice ().Value ())
32493263
32503264 assert .Equal (t , []float64 (nil ), (& FloatSlice {}).Value ())
3265+ assert .Equal (t , []float32 (nil ), (& Float32Slice {}).Value ())
3266+ assert .Equal (t , []float64 (nil ), (& Float64Slice {}).Value ())
32513267 assert .Equal (t , []int64 (nil ), (& Int64Slice {}).Value ())
32523268 assert .Equal (t , []uint64 (nil ), (& Uint64Slice {}).Value ())
32533269 assert .Equal (t , []string (nil ), (& StringSlice {}).Value ())
0 commit comments