Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use t.TempDir() instead of os.MkdirTemp #2476

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

tgolang
Copy link
Contributor

@tgolang tgolang commented Mar 8, 2025

TempDir() is a method introduced in Go 1.15 for testing.T. It automatically creates a temporary directory and cleans it up after the test is complete, eliminating the hassle of manually handling errors and cleanup. More detail about TempDir https://pkg.go.dev/testing#B.TempDir

Signed-off-by: tgolang <seekseat@aliyun.com>
@jrick jrick merged commit 60e207c into decred:master Mar 8, 2025
2 checks passed
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.

3 participants