k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.79k stars 368 forks source link

chore(lint): fix some linting complains #4946

Closed ricardomaraschini closed 2 months ago

ricardomaraschini commented 2 months ago

Description

this addresses the following complains i found running the lint locally:

pkg/apis/k0s/v1beta1/storage.go:276:5: S1009: should omit nil check; len() for []string is defined as zero (gosimple)
        if e.Endpoints == nil || len(e.Endpoints) == 0 {
           ^
internal/pkg/iptablesutils/iptables_test.go:215:1: SA3000: TestMain should call os.Exit to set exit code (staticcheck)
func TestMain(m *testing.M) {
^
inttest/cli/cli_test.go:64:10: printf: non-constant format string in call to (*testing.common).Logf (govet)
                t.Logf(out)
                       ^

Type of change

How Has This Been Tested?

Checklist: