@@ -185,29 +185,29 @@ func TestCopyDir(t *testing.T) {
185185
186186 defer DeleteFiles (join (tmpDir , "test1" ))
187187
188- err := CopyDir (
188+ err1 := CopyDir (
189189 join (tmpDir , "target" ),
190190 join (testdataPath , "not-exists-dir" ),
191191 Excludes {},
192192 )
193- assert .NotNil (t , err )
193+ assert .NotNil (t , err1 )
194194
195- err = CopyDir (
195+ err2 : = CopyDir (
196196 join (tmpDir , "target" ),
197197 join (testdataPath , "sample.txt" ),
198198 Excludes {},
199199 )
200- assert .NotNil (t , err )
200+ assert .NotNil (t , err2 )
201201
202- err = CopyDir (tmpDir , testdataPath , Excludes {})
203- assert .True (t , strings .HasPrefix (err .Error (), "destination dir already exists" ))
202+ err3 : = CopyDir (tmpDir , testdataPath , Excludes {})
203+ assert .True (t , strings .HasPrefix (err3 .Error (), "destination dir already exists" ))
204204
205- err = CopyDir (join (tmpDir , "target" ), testdataPath , Excludes {"[]a]" })
206- assert .NotNil (t , err )
205+ err4 : = CopyDir (join (tmpDir , "target" ), testdataPath , Excludes {"[]a]" })
206+ assert .NotNil (t , err4 )
207207
208208 pwd , _ := os .Getwd ()
209- err = CopyDir (join (tmpDir , "test1" ), pwd , Excludes {"test*" , "*conf" , ".*" })
210- assert .FailNowOnError (t , err , "copy directory failed" )
209+ err5 : = CopyDir (join (tmpDir , "test1" ), pwd , Excludes {"test*" , "*conf" , ".*" })
210+ assert .FailNowOnError (t , err5 , "copy directory failed" )
211211}
212212
213213func TestStripExt (t * testing.T ) {
@@ -228,6 +228,7 @@ func TestDirPaths(t *testing.T) {
228228 path12 := join (testdataPath , "dirpaths" , "level1" , "level1-2" )
229229 path21 := join (testdataPath , "dirpaths" , "level1" , "level2" , "level2-1" )
230230 path22 := join (testdataPath , "dirpaths" , "level1" , "level2" , "level2-2" )
231+ defer DeleteFiles (join (testdataPath , "dirpaths" ))
231232
232233 _ = MkDirAll (path1 , 0755 )
233234 _ = MkDirAll (path11 , 0755 )
0 commit comments