Compare commits

..

No commits in common. '62da883e113cc5970f34b01529d9050d4a336671' and '40ce965ae12c5d75ab529ed736ba4138ee9667a6' have entirely different histories.

@ -22,10 +22,8 @@ linters:
- predeclared - predeclared
- revive - revive
- testifylint - testifylint
- thelper
- typecheck - typecheck
- unparam - unparam
- usetesting
disable: disable:
- errcheck - errcheck
- govet - govet
@ -102,23 +100,3 @@ linters-settings:
disabled: true disabled: true
testifylint: testifylint:
enable-all: true enable-all: true
thelper:
test:
# Check t.Helper() begins helper function.
# Default: true
begin: false
benchmark:
# Check b.Helper() begins helper function.
# Default: true
begin: false
tb:
# Check tb.Helper() begins helper function.
# Default: true
begin: false
fuzz:
# Check f.Helper() begins helper function.
# Default: true
begin: false
usetesting:
os-create-temp: false
os-mkdir-temp: false

@ -9,9 +9,9 @@ import (
"github.com/shirou/gopsutil/v4/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func skipIfNotImplementedErr(tb testing.TB, err error) { func skipIfNotImplementedErr(t testing.TB, err error) {
if errors.Is(err, common.ErrNotImplementedError) { if errors.Is(err, common.ErrNotImplementedError) {
tb.Skip("not implemented") t.Skip("not implemented")
} }
} }
@ -72,15 +72,15 @@ func TestMiscStatString(t *testing.T) {
} }
func BenchmarkLoad(b *testing.B) { func BenchmarkLoad(b *testing.B) {
loadAvg := func(tb testing.TB) { loadAvg := func(t testing.TB) {
v, err := Avg() v, err := Avg()
skipIfNotImplementedErr(tb, err) skipIfNotImplementedErr(t, err)
if err != nil { if err != nil {
tb.Errorf("error %v", err) t.Errorf("error %v", err)
} }
empty := &AvgStat{} empty := &AvgStat{}
if v == empty { if v == empty {
tb.Errorf("error load: %v", v) t.Errorf("error load: %v", v)
} }
} }

Loading…
Cancel
Save