@@ -772,6 +772,8 @@ func TestStringSliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
772772 _ = fl .Apply (set )
773773
774774 err := set .Parse (nil )
775+
776+ _ = fl .PostParse ()
775777 assert .NoError (t , err )
776778 assert .Equal (t , []string {"vincent van goat" , "scape goat" }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ())
777779}
@@ -785,6 +787,7 @@ func TestStringSliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
785787 set := flag .NewFlagSet ("test" , 0 )
786788 _ = fl .Apply (set )
787789 err := set .Parse (nil )
790+ _ = fl .PostParse ()
788791 assert .NoError (t , err )
789792 assert .Equal (t , []string {"vincent van goat" , "scape goat" }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ())
790793}
@@ -798,6 +801,8 @@ func TestStringSliceFlagApply_DefaultValueWithDestination(t *testing.T) {
798801 _ = fl .Apply (set )
799802
800803 err := set .Parse ([]string {})
804+
805+ _ = fl .PostParse ()
801806 assert .NoError (t , err )
802807 assert .Equal (t , defValue , dest )
803808}
@@ -1056,6 +1061,7 @@ func TestIntSliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
10561061 r := require .New (t )
10571062 r .NoError (fl .Apply (set ))
10581063 r .NoError (set .Parse (nil ))
1064+ r .NoError (fl .PostParse ())
10591065 r .Equal ([]int64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ())
10601066}
10611067
@@ -1068,6 +1074,7 @@ func TestIntSliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
10681074 r := require .New (t )
10691075 r .NoError (fl .Apply (set ))
10701076 r .NoError (set .Parse (nil ))
1077+ r .NoError (fl .PostParse ())
10711078 r .Equal ([]int64 {3 , 4 }, val )
10721079 r .Equal ([]int64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ())
10731080}
@@ -1081,6 +1088,7 @@ func TestIntSliceFlagApply_DefaultValueWithDestination(t *testing.T) {
10811088 _ = fl .Apply (set )
10821089
10831090 err := set .Parse ([]string {})
1091+ assert .NoError (t , fl .PostParse ())
10841092 assert .NoError (t , err )
10851093 assert .Equal (t , defValue , dest )
10861094}
@@ -1184,6 +1192,7 @@ func TestUintSliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
11841192 r .NoError (fl .Apply (set ))
11851193
11861194 r .NoError (set .Parse (nil ))
1195+ r .NoError (fl .PostParse ())
11871196 r .Equal ([]uint64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ().([]uint64 ))
11881197}
11891198
@@ -1195,6 +1204,7 @@ func TestUintSliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
11951204 r := require .New (t )
11961205 r .NoError (fl .Apply (set ))
11971206 r .NoError (set .Parse (nil ))
1207+ r .NoError (fl .PostParse ())
11981208 r .Equal ([]uint64 {3 , 4 }, val .Value ())
11991209 r .Equal ([]uint64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ().([]uint64 ))
12001210}
@@ -1209,6 +1219,7 @@ func TestUintSliceFlagApply_DefaultValueWithDestination(t *testing.T) {
12091219
12101220 err := set .Parse ([]string {})
12111221 assert .NoError (t , err )
1222+ assert .NoError (t , fl .PostParse ())
12121223 assert .Equal (t , defValue , dest )
12131224}
12141225
@@ -1328,6 +1339,7 @@ func TestUint64SliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
13281339
13291340 err := set .Parse (nil )
13301341 assert .NoError (t , err )
1342+ assert .NoError (t , fl .PostParse ())
13311343 assert .Equal (t , []uint64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ().([]uint64 ))
13321344}
13331345
@@ -1341,6 +1353,7 @@ func TestUint64SliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
13411353 _ = fl .Apply (set )
13421354 err := set .Parse (nil )
13431355 assert .NoError (t , err )
1356+ assert .NoError (t , fl .PostParse ())
13441357 assert .Equal (t , []uint64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ().([]uint64 ))
13451358}
13461359
@@ -1354,6 +1367,7 @@ func TestUint64SliceFlagApply_DefaultValueWithDestination(t *testing.T) {
13541367
13551368 err := set .Parse ([]string {})
13561369 assert .NoError (t , err )
1370+ assert .NoError (t , fl .PostParse ())
13571371 assert .Equal (t , defValue , dest )
13581372}
13591373
@@ -1519,6 +1533,7 @@ func TestFloat64SliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
15191533
15201534 err := set .Parse (nil )
15211535 assert .NoError (t , err )
1536+ assert .NoError (t , fl .PostParse ())
15221537 assert .Equal (t , []float64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ().([]float64 ))
15231538}
15241539
@@ -1532,6 +1547,7 @@ func TestFloat64SliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
15321547 _ = fl .Apply (set )
15331548 err := set .Parse (nil )
15341549 assert .NoError (t , err )
1550+ assert .NoError (t , fl .PostParse ())
15351551 assert .Equal (t , []float64 {1 , 2 }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ().([]float64 ))
15361552}
15371553
@@ -3056,7 +3072,9 @@ func TestStringMapFlagApply_UsesEnvValues_noDefault(t *testing.T) {
30563072 _ = fl .Apply (set )
30573073
30583074 err := set .Parse (nil )
3075+
30593076 assert .NoError (t , err )
3077+ assert .NoError (t , fl .PostParse ())
30603078 assert .Nil (t , val )
30613079 assert .Equal (t , map [string ]string {"vincent van goat" : "scape goat" }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ())
30623080}
@@ -3071,6 +3089,7 @@ func TestStringMapFlagApply_UsesEnvValues_withDefault(t *testing.T) {
30713089 _ = fl .Apply (set )
30723090 err := set .Parse (nil )
30733091 assert .NoError (t , err )
3092+ assert .NoError (t , fl .PostParse ())
30743093 assert .Equal (t , map [string ]string {`some default` : `values here` }, val )
30753094 assert .Equal (t , map [string ]string {"vincent van goat" : "scape goat" }, set .Lookup ("goat" ).Value .(flag.Getter ).Get ())
30763095}
0 commit comments