client/pkg/kn/plugin
Eng Zer Jun 736c7c24ef
test: use `T.TempDir` to create temporary test directory (#1660)
* test: use `T.TempDir` to create temporary test directory

This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* docs: update CHANGELOG.adoc

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-21 11:53:30 +00:00
..
manager.go Fixing bug when looking up plugins on path with slash in argument (#1415) 2021-08-06 09:00:20 -07:00
manager_test.go test: use `T.TempDir` to create temporary test directory (#1660) 2022-04-21 11:53:30 +00:00
stat.go Combine update deps actions format manually (#1484) 2021-10-18 08:56:36 -07:00
stat_windows.go Refactor main flow and introduce explicit plugin and config handling (#877) 2020-06-15 09:15:24 -07:00
verify.go Enable errorlint and fix all issues (#1223) 2021-02-12 18:27:38 -08:00
verify_test.go Upgrade a few assorted dependencies (#1220) 2021-02-12 05:55:50 -08:00