fleet/server/logging
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
..
mock Add AWS Lambda as logging plugin (#347) 2021-02-24 10:02:26 -08:00
filesystem_test.go test: use T.TempDir to create temporary test directory (#6080) 2022-06-13 10:20:38 -03:00
filesystem.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
firehose_test.go make context type value header configurable (#4441) 2022-03-09 17:22:29 -05:00
firehose.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
kafkarest_test.go make context type value header configurable (#4441) 2022-03-09 17:22:29 -05:00
kafkarest.go make context type value header configurable (#4441) 2022-03-09 17:22:29 -05:00
kinesis_test.go append newline char to raw log bytes for nice NDJSON format (#4425) 2022-03-02 17:23:23 -05:00
kinesis.go append newline char to raw log bytes for nice NDJSON format (#4425) 2022-03-02 17:23:23 -05:00
lambda_test.go Add v4 suffix in go.mod (#1224) 2021-06-25 21:46:51 -07:00
lambda.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
logging.go Fix some config mismatches in osquery logging (#5488) 2022-05-10 11:27:32 -04:00
pubsub.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
stdout.go Add stdout and kinesis logger plugins and sts assume role to Firehose (#2282) 2020-08-19 14:56:44 -07:00