@@ -46,10 +46,11 @@ func TestDS(t *testing.T) {
4646
4747 vals := []string {"1ns" , "2ms" , "3m" , "4h" }
4848 arg := fmt .Sprintf ("--ds=%s" , strings .Join (vals , "," ))
49- err := f .Parse ([]string {arg })
50- if err != nil {
51- t .Fatal ("expected no error; got" , err )
49+ erp := f .Parse ([]string {arg })
50+ if erp != nil {
51+ t .Fatal ("expected no error; got" , erp )
5252 }
53+
5354 for i , v := range ds {
5455 d , err := time .ParseDuration (vals [i ])
5556 if err != nil {
@@ -59,10 +60,12 @@ func TestDS(t *testing.T) {
5960 t .Fatalf ("expected ds[%d] to be %s but got: %d" , i , vals [i ], v )
6061 }
6162 }
62- getDS , err := f .GetDurationSlice ("ds" )
63- if err != nil {
64- t .Fatalf ("got error: %v" , err )
63+
64+ getDS , erd := f .GetDurationSlice ("ds" )
65+ if erd != nil {
66+ t .Fatalf ("got error: %v" , erd )
6567 }
68+
6669 for i , v := range getDS {
6770 d , err := time .ParseDuration (vals [i ])
6871 if err != nil {
@@ -80,10 +83,11 @@ func TestDSDefault(t *testing.T) {
8083
8184 vals := []string {"0s" , "1ns" }
8285
83- err := f .Parse ([]string {})
84- if err != nil {
85- t .Fatal ("expected no error; got" , err )
86+ erp := f .Parse ([]string {})
87+ if erp != nil {
88+ t .Fatal ("expected no error; got" , erp )
8689 }
90+
8791 for i , v := range ds {
8892 d , err := time .ParseDuration (vals [i ])
8993 if err != nil {
@@ -94,10 +98,11 @@ func TestDSDefault(t *testing.T) {
9498 }
9599 }
96100
97- getDS , err := f .GetDurationSlice ("ds" )
98- if err != nil {
99- t .Fatal ("got an error from GetDurationSlice():" , err )
101+ getDS , erd := f .GetDurationSlice ("ds" )
102+ if erd != nil {
103+ t .Fatal ("got an error from GetDurationSlice():" , erd )
100104 }
105+
101106 for i , v := range getDS {
102107 d , err := time .ParseDuration (vals [i ])
103108 if err != nil {
@@ -115,10 +120,11 @@ func TestDSWithDefault(t *testing.T) {
115120
116121 vals := []string {"1ns" , "2ns" }
117122 arg := fmt .Sprintf ("--ds=%s" , strings .Join (vals , "," ))
118- err := f .Parse ([]string {arg })
119- if err != nil {
120- t .Fatal ("expected no error; got" , err )
123+ erp := f .Parse ([]string {arg })
124+ if erp != nil {
125+ t .Fatal ("expected no error; got" , erp )
121126 }
127+
122128 for i , v := range ds {
123129 d , err := time .ParseDuration (vals [i ])
124130 if err != nil {
@@ -129,10 +135,11 @@ func TestDSWithDefault(t *testing.T) {
129135 }
130136 }
131137
132- getDS , err := f .GetDurationSlice ("ds" )
133- if err != nil {
134- t .Fatal ("got an error from GetDurationSlice():" , err )
138+ getDS , erd := f .GetDurationSlice ("ds" )
139+ if erd != nil {
140+ t .Fatal ("got an error from GetDurationSlice():" , erd )
135141 }
142+
136143 for i , v := range getDS {
137144 d , err := time .ParseDuration (vals [i ])
138145 if err != nil {
@@ -180,6 +187,7 @@ func TestDSCalledTwice(t *testing.T) {
180187 if err != nil {
181188 t .Fatal ("expected no error; got" , err )
182189 }
190+
183191 for i , v := range ds {
184192 if expected [i ] != v {
185193 t .Fatalf ("expected ds[%d] to be %d but got: %d" , i , expected [i ], v )
0 commit comments