Skip to content

test: replace tmpdir workaround with native T tmp

feistel requested to merge feistel/gitlab-pages:refactor/test-tmp into master

What does this MR do?

Go 1.15 added native support for test tmp directories so there's no need for the current workaround (mkdir + cleanup func).

From https://golang.org/doc/go1.15:

The new methods T.TempDir and B.TempDir return temporary directories that are automatically cleaned up at the end of the test.

Method doc:

TempDir returns a temporary directory for the test to use. The directory is automatically removed by Cleanup when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory; if the directory creation fails, TempDir terminates the test by calling Fatal.

TODO

Merge request reports