From edc7998408e700323fc7b6f8a9537ac16dfc6c13 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 9 May 2021 12:12:22 +0200 Subject: [PATCH] sync: tests: properly scope err variable --- cmd/safcm-remote/sync/files_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.45.2