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

test: use T.TempDir to create temporary test directory #2344

Merged
merged 1 commit into from
Mar 30, 2022
Merged

test: use T.TempDir to create temporary test directory #2344

merged 1 commit into from
Mar 30, 2022

Conversation

Juneezee
Copy link
Contributor

What does this pull request do? Explain your changes. (required)

A testing cleanup. We can use the T.TempDir function from the testing package to create temporary directory. The directory created by T.TempDir is automatically removed when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir

Specific updates (required)

  • Replaces ioutil.TempDir with t.TempDir

How did you test each of these updates (required)

Testing environment: Linux 5.16.16, amd64, Go 1.18

  • Run the changed test cases on Goland
  • ./test.sh

Does this pull request close any open issues?

N/A

Checklist:

The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <[email protected]>
Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @Juneezee. LGTM

@leszko leszko merged commit 94df056 into livepeer:master Mar 30, 2022
ad-astra-video pushed a commit to ad-astra-video/go-livepeer that referenced this pull request May 25, 2022
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <[email protected]>
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.

None yet

2 participants