shirou_gopsutil/cpu
Eng Zer Jun 37894e9b28
test: use `T.Setenv` to set env vars in tests
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-12-20 13:13:01 +08:00
..
testdata fix dependabot v2 deletion. 2021-12-01 00:12:55 +00:00
cpu.go fix(cpu): fix cpu total and busy calc 2022-07-09 02:13:44 +00:00
cpu_aix.go aix: split code, that uses perfstat, to _cgo and _nocgo files 2022-06-03 17:01:36 +02:00
cpu_aix_cgo.go fix go build flags for aix/cpu 2022-06-03 17:09:11 +02:00
cpu_aix_nocgo.go parse cpu values as float 2022-06-17 15:10:37 +02:00
cpu_darwin.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_darwin_cgo.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_darwin_nocgo.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_dragonfly.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_dragonfly_amd64.go cpu: support for DragonflyBSD 2020-06-18 10:17:23 +02:00
cpu_fallback.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_freebsd.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_freebsd_386.go Eliminate use of sysctl command on FreeBSD 2017-10-05 08:45:56 +01:00
cpu_freebsd_amd64.go Eliminate use of sysctl command on FreeBSD 2017-10-05 08:45:56 +01:00
cpu_freebsd_arm.go add FreeBSD ARM support. copied from i386 2019-01-17 16:49:20 +09:00
cpu_freebsd_arm64.go Add support for freebsd/arm64 2019-12-17 03:12:29 -05:00
cpu_freebsd_test.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_linux.go fill modelName for all cores in arm64 devices 2022-12-06 14:56:51 +03:00
cpu_linux_test.go test: use `T.Setenv` to set env vars in tests 2022-12-20 13:13:01 +08:00
cpu_openbsd.go avoid cgo for cpu_openbsd 2022-02-24 15:05:18 +01:00
cpu_openbsd_386.go avoid cgo for cpu_openbsd 2022-02-24 15:05:18 +01:00
cpu_openbsd_amd64.go avoid cgo for cpu_openbsd 2022-02-24 15:05:18 +01:00
cpu_openbsd_arm.go host: add support for OpenBSD/armv7 2022-04-15 21:11:36 +02:00
cpu_openbsd_arm64.go Fix telegraf 1.22.0 build on OpenBSD/arm64: 2022-03-24 17:55:48 +01:00
cpu_plan9.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_plan9_test.go test: use `T.Setenv` to set env vars in tests 2022-12-20 13:13:01 +08:00
cpu_solaris.go refactor: remove unnecessary exec.LookPath calls 2022-03-04 18:56:33 +02:00
cpu_solaris_test.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_test.go gofumpt 2021-12-22 21:54:41 +00:00
cpu_windows.go cpu: use windows.GetActiveProcessorCount 2022-12-07 13:51:29 +01:00