cli: drop dead defer in test TestMain that os.Exit skips · Entire

cli: drop dead defer in test TestMain that os.Exit skips

28f560a→main·

Soph·1mo ago·1 file·+0 added/-3 removed

The deferred os.RemoveAll never ran because TestMain ends with os.Exit(code); the same cleanup already runs explicitly just before the exit. Removing it clears the gocritic exitAfterDefer lint failure.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

438e4b46f73cView transcript

[?
Fix Linting Issues in CLI TestsClaude Code·Opus 4.8[1m]·1 step](/content/gh/entireio/cli/session/3c14ffab-c272-4740-ae58-a4b1abd5e06d#timeline-438e4b46f73c/index.html)

Changes

1

31 unmodified lines

32
33
34
35
36
37
35
36
37

31 unmodified lines

if err != nil {
        panic(fmt.Errorf("failed to create test isolation dir: %w", err))
    }
    defer func() {
        _ = os.RemoveAll(isolationDir)
    }()
    os.Setenv("ENTIRE_TOKEN_STORE", "file")
    os.Setenv("ENTIRE_TOKEN_STORE_PATH", filepath.Join(isolationDir, "tokenstore.json"))
    os.Setenv("ENTIRE_TEST_AUTH_STORE_FILE", filepath.Join(isolationDir, "auth-tokens.json"))

Mcmd/entire/cli/global_test.go-3