Skip to content

cmd/dlv, pkg/proc: use T.TempDir in tests for temp dirs - #3256

Merged
derekparker merged 1 commit into
go-delve:masterfrom
alexandear-org:cmd-dlv-t-temp-dir
Jan 30, 2023
Merged

derekparker merged 1 commit into
go-delve:masterfrom
alexandear-org:cmd-dlv-t-temp-dir

Conversation

@alexandear

@alexandear alexandear commented Jan 24, 2023 •

Copy link
Copy Markdown
Contributor

This PR simplifies tests in cmd/dlv and pkg/proc by replacing usages of ioutil.TempDir with t.TempDir.

T.TempDir automatically removes the temporary directory at the end of a test. So, no need to manually call defer os.RemoveAll(tmpDir)

@alexandear alexandear changed the title cmd/dlv: use T.TempDir in tests for temp dirs cmd/dlv, pkg/proc: use T.TempDir in tests for temp dirs Jan 24, 2023
@alexandear
alexandear marked this pull request as ready for review January 24, 2023 20:18

@aarzilli aarzilli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekparker derekparker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@derekparker
derekparker merged commit 64a9024 into go-delve:master Jan 30, 2023
@alexandear
alexandear deleted the cmd-dlv-t-temp-dir branch January 31, 2023 09:59
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