From 641203fda8f7da72c74562c9dc910ca108116f11 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 5 Apr 2021 10:47:40 +0200 Subject: [PATCH] config: remove unnecessary os.Chdir in test --- cmd/safcm/config/groups_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/safcm/config/groups_test.go b/cmd/safcm/config/groups_test.go index b2bf5ec..cf6cd6e 100644 --- a/cmd/safcm/config/groups_test.go +++ b/cmd/safcm/config/groups_test.go @@ -18,6 +18,7 @@ package config import ( "fmt" "os" + "path/filepath" "reflect" "testing" @@ -186,7 +187,7 @@ func TestLoadGroups(t *testing.T) { for _, tc := range tests { t.Run(tc.path, func(t *testing.T) { - err := os.Chdir(tc.path) + err := os.Chdir(filepath.Join(cwd, tc.path)) if err != nil { t.Fatal(err) } @@ -201,11 +202,6 @@ func TestLoadGroups(t *testing.T) { t.Errorf("err = %#v, want %#v", err, tc.expErr) } - - err = os.Chdir(cwd) - if err != nil { - t.Fatal(err) - } }) } } -- 2.44.1