fleet/orbit/pkg
Eng Zer Jun abe33f1d8d
test: use T.TempDir to create temporary test directory (#6080)
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>
2022-06-13 10:20:38 -03:00
..
build Add user agent to Orbit HTTP client (#5429) 2022-05-02 11:03:49 -07:00
constant Shebang should be on the first line of script (#5747) 2022-05-23 19:18:19 -03:00
execuser Do not use golangci action for better reproducibility (use make lint-go) (#6175) 2022-06-10 18:52:24 -03:00
insecure Make creation of http.Client uniform across the codebase (#3097) 2021-11-24 15:56:54 -05:00
osquery Add automation for orbit shell (with TUF) (#5856) 2022-06-01 13:54:16 -03:00
packaging Orbit: Add early update checks before starting sub-systems (#5885) 2022-06-01 14:47:04 -03:00
platform Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
process Fleetctl to package .app bundles for osquery (and changes for orbit to support them) (#4393) 2022-03-15 16:04:12 -03:00
table Upgrade osquery-go (#4728) 2022-03-23 12:15:37 -03:00
update test: use T.TempDir to create temporary test directory (#6080) 2022-06-13 10:20:38 -03:00