.*: 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 <madhav.jiv@gmail.com>
This commit is contained in:
Madhav Jivrajani 2024-07-15 13:46:09 +05:30
parent 0d2c0e0d3c
commit c5481b0413
2 changed files with 2 additions and 12 deletions

View File

@ -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)

View File

@ -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())
}