Skip to content

Commit cc1cdc7

Browse files
authored
Merge pull request #214 from hugoh/deepsource-autofix-87756bf0
2 parents 6ebde82 + 100048b commit cc1cdc7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/main_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ func TestMain(m *testing.M) {
2222
os.Exit(1)
2323
}
2424

25-
if err := os.Setenv("HOME", dir); err != nil {
26-
os.Exit(1)
27-
}
25+
origHome := os.Getenv("HOME")
26+
_ = os.Setenv("HOME", dir) // skipcq: GO-W1032
2827

2928
// Override spinnerFunc with a mock to prevent data races from async goroutines
3029
spinnerFunc = func(_ string) (spinner, error) {
@@ -38,6 +37,8 @@ func TestMain(m *testing.M) {
3837

3938
code := m.Run()
4039

40+
_ = os.Setenv("HOME", origHome) // skipcq: GO-W1032
41+
4142
if err := os.RemoveAll(dir); err != nil {
4243
os.Exit(1)
4344
}

0 commit comments

Comments
 (0)