Skip to content

Fix shadowed dir variable in TestMain#152

Merged
mattn merged 1 commit intomasterfrom
fix-shadowed-dir-variable
Apr 2, 2026
Merged

Fix shadowed dir variable in TestMain#152
mattn merged 1 commit intomasterfrom
fix-shadowed-dir-variable

Conversation

@mattn
Copy link
Copy Markdown
Owner

@mattn mattn commented Apr 2, 2026

The ':=' on os.MkdirTemp shadowed the outer 'dir' variable, so the cleanup code at the end of TestMain never removed the temp directory.

The ':=' on os.MkdirTemp created a new 'dir' in the inner scope,
leaving the outer 'dir' empty. The cleanup code at the end of
TestMain never ran as a result.
@mattn mattn merged commit 9bbbc9f into master Apr 2, 2026
2 checks passed
@mattn mattn deleted the fix-shadowed-dir-variable branch April 2, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant