Skip to content

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

Merged
kezhenxu94 merged 1 commit intoapache:mainfrom
Juneezee:test/t.TempDir
Mar 12, 2022
Merged

test: use T.TempDir to create temporary test directory#95
kezhenxu94 merged 1 commit intoapache:mainfrom
Juneezee:test/t.TempDir

Conversation

@Juneezee
Copy link
Contributor

A small testing enhancement.

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

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 <engzerjun@gmail.com>
@wu-sheng wu-sheng requested a review from kezhenxu94 March 12, 2022 07:59
@wu-sheng wu-sheng added this to the 0.3.0 milestone Mar 12, 2022
@wu-sheng wu-sheng added the enhancement New feature or request label Mar 12, 2022
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

Nice clean!

@wu-sheng wu-sheng added the test label Mar 12, 2022
@kezhenxu94 kezhenxu94 merged commit 831233e into apache:main Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants