From b3fc4ba11afcb1655048cf833573d65c4842ed5b Mon Sep 17 00:00:00 2001 From: Madhav Jivrajani Date: Mon, 15 Jul 2024 13:46:09 +0530 Subject: [PATCH] .*: fix lint errors Fix SA4032 and SA3000 which are flagged after bumping to go1.23rc1 and v0.5.0-rc1 of go-tools. Signed-off-by: Madhav Jivrajani --- pkg/util/procfs/procfs_linux_test.go | 11 ----------- .../component-base/logs/example/test/logger_test.go | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/pkg/util/procfs/procfs_linux_test.go b/pkg/util/procfs/procfs_linux_test.go index 968b5e32a71..b021afd9c2d 100644 --- a/pkg/util/procfs/procfs_linux_test.go +++ b/pkg/util/procfs/procfs_linux_test.go @@ -24,7 +24,6 @@ import ( "os/signal" "path/filepath" "regexp" - "runtime" "syscall" "testing" "time" @@ -69,9 +68,6 @@ func TestContainerNameFromProcCgroup(t *testing.T) { } func TestPidOf(t *testing.T) { - if runtime.GOOS == "darwin" || runtime.GOOS == "windows" { - t.Skipf("not supported on GOOS=%s", runtime.GOOS) - } pids, err := PidOf(filepath.Base(os.Args[0])) assert.Empty(t, err) assert.NotZero(t, pids) @@ -79,9 +75,6 @@ func TestPidOf(t *testing.T) { } func TestPKill(t *testing.T) { - if runtime.GOOS == "darwin" || runtime.GOOS == "windows" { - t.Skipf("not supported on GOOS=%s", runtime.GOOS) - } sig := syscall.SIGCONT c := make(chan os.Signal, 1) signal.Notify(c, sig) @@ -98,10 +91,6 @@ func TestPKill(t *testing.T) { } func BenchmarkGetPids(b *testing.B) { - if runtime.GOOS == "darwin" || runtime.GOOS == "windows" { - b.Skipf("not supported on GOOS=%s", runtime.GOOS) - } - re, err := regexp.Compile("(^|/)" + filepath.Base(os.Args[0]) + "$") assert.Empty(b, err) diff --git a/staging/src/k8s.io/component-base/logs/example/test/logger_test.go b/staging/src/k8s.io/component-base/logs/example/test/logger_test.go index 5d8c389778e..a3a6bbe7b40 100644 --- a/staging/src/k8s.io/component-base/logs/example/test/logger_test.go +++ b/staging/src/k8s.io/component-base/logs/example/test/logger_test.go @@ -21,6 +21,7 @@ package logger_test import ( "flag" + "os" "testing" "k8s.io/component-base/logs/example" @@ -49,5 +50,5 @@ func TestMain(m *testing.M) { ktesting.DefaultConfig = ktesting.NewConfig(ktesting.Verbosity(2)) ktesting.DefaultConfig.AddFlags(flag.CommandLine) flag.Parse() - m.Run() + os.Exit(m.Run()) }