From: Simon Ruderich Date: Sun, 9 May 2021 10:12:22 +0000 (+0200) Subject: sync: tests: properly scope err variable X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=edc7998408e700323fc7b6f8a9537ac16dfc6c13;p=safcm%2Fsafcm.git sync: tests: properly scope err variable --- diff --git a/cmd/safcm-remote/sync/files_test.go b/cmd/safcm-remote/sync/files_test.go index 11d386d..3cf7e04 100644 --- a/cmd/safcm-remote/sync/files_test.go +++ b/cmd/safcm-remote/sync/files_test.go @@ -834,7 +834,7 @@ func TestSyncFiles(t *testing.T) { // Create separate test directory for each test case path := filepath.Join(cwd, "testdata", "files-"+tc.name) - err = os.Mkdir(path, 0700) + err := os.Mkdir(path, 0700) if err != nil { t.Fatal(err) } @@ -852,7 +852,7 @@ func TestSyncFiles(t *testing.T) { }) s.setDefaults() - err := s.syncFiles() + err = s.syncFiles() testutil.AssertErrorEqual(t, "err", err, tc.expErr) dbg := res.Wait() // Remove random file names from result @@ -2374,7 +2374,7 @@ file t.Run(tc.name, func(t *testing.T) { // Create separate test directory for each test case path := filepath.Join(cwd, "testdata", "file-"+tc.name) - err = os.Mkdir(path, 0700) + err := os.Mkdir(path, 0700) if err != nil { t.Fatal(err) } @@ -2396,7 +2396,7 @@ file rand.Seed(0) var changed bool - err := s.syncFile(tc.file, &changed) + err = s.syncFile(tc.file, &changed) testutil.AssertErrorEqual(t, "err", err, tc.expErr) dbg := res.Wait() // Remove random file names from result