diff --git a/.golangci.yml b/.golangci.yml index fc415a734044..cd8adb3c7c8e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,7 @@ linters: - errorlint # Find code that will cause problems with Go's error wrapping scheme - gofmt # Checks whether code was gofmt-ed - goheader # Checks is file headers matche a given pattern + - nolintlint # Find ill-formed or insufficiently explained nolint directives - revive # Stricter drop-in replacement for golint linters-settings: diff --git a/internal/pkg/sysinfo/probes/linux/linux.go b/internal/pkg/sysinfo/probes/linux/linux.go index 0f936746a901..55c675740f44 100644 --- a/internal/pkg/sysinfo/probes/linux/linux.go +++ b/internal/pkg/sysinfo/probes/linux/linux.go @@ -133,7 +133,7 @@ func newUnameProber() unameProber { } func parseUname(utsname *syscall.Utsname) *uname { - convert := func(chars utsStringPtr) unameField { + convert := func(chars *[65]utsChar) unameField { var buf [65]byte var i int for pos, ch := range *chars { diff --git a/internal/pkg/sysinfo/probes/linux/types.go b/internal/pkg/sysinfo/probes/linux/types.go index 20408fab521d..4d13558a76d6 100644 --- a/internal/pkg/sysinfo/probes/linux/types.go +++ b/internal/pkg/sysinfo/probes/linux/types.go @@ -18,6 +18,4 @@ limitations under the License. package linux -func utsChar(ch rune) int8 { return int8(ch) } //nolint:deadcode,unused // just for tests 🙄 - -type utsStringPtr *[65]int8 +type utsChar = int8 diff --git a/internal/pkg/sysinfo/probes/linux/types_arm.go b/internal/pkg/sysinfo/probes/linux/types_arm.go index 6dc049602073..9a893a268d97 100644 --- a/internal/pkg/sysinfo/probes/linux/types_arm.go +++ b/internal/pkg/sysinfo/probes/linux/types_arm.go @@ -18,6 +18,4 @@ limitations under the License. package linux -func utsChar(ch rune) uint8 { return uint8(ch) } //nolint:deadcode,unused // just for tests 🙄 - -type utsStringPtr *[65]uint8 +type utsChar = uint8 diff --git a/pkg/autopilot/controller/root/root.go b/pkg/autopilot/controller/root/root.go index a8f9e62a6a8c..70598201ac10 100644 --- a/pkg/autopilot/controller/root/root.go +++ b/pkg/autopilot/controller/root/root.go @@ -19,7 +19,6 @@ import ( ) // TODO: decide on renaming root.RootConfig -> root.Config -// nolint:revive type RootConfig struct { InvocationID string KubeConfig string diff --git a/pkg/component/controller/workerconfig/reconciler_test.go b/pkg/component/controller/workerconfig/reconciler_test.go index e6018deae1bb..8103bd7629fb 100644 --- a/pkg/component/controller/workerconfig/reconciler_test.go +++ b/pkg/component/controller/workerconfig/reconciler_test.go @@ -584,7 +584,7 @@ func TestReconciler_runReconcileLoop(t *testing.T) { underTest.runReconcileLoop(ctx, updates, nil) - switch ctx.Err() { //nolint:errorlint // as per context contract + switch ctx.Err() { case context.Canceled: break // this is the good case case context.DeadlineExceeded: