From d92c70b82693f3c974e63dcf7abd2d5068c0530c Mon Sep 17 00:00:00 2001 From: "xin.li" Date: Sun, 23 Feb 2025 16:54:43 +0800 Subject: [PATCH] enable go-required check Signed-off-by: xin.li --- hack/golangci.yaml | 1 - hack/golangci.yaml.in | 1 - .../admission/plugin/policy/internal/generic/controller_test.go | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hack/golangci.yaml b/hack/golangci.yaml index ff24e6d6d18..ed5382dc0f1 100644 --- a/hack/golangci.yaml +++ b/hack/golangci.yaml @@ -277,5 +277,4 @@ linters-settings: # please keep this alphabetized enable-all: true disable: # TODO: remove each disabled rule and fix it - float-compare - - go-require - require-error diff --git a/hack/golangci.yaml.in b/hack/golangci.yaml.in index c567600e841..a7f5494a487 100644 --- a/hack/golangci.yaml.in +++ b/hack/golangci.yaml.in @@ -242,7 +242,6 @@ linters-settings: # please keep this alphabetized disable: # TODO: remove each disabled rule and fix it {{- if .Base }} - float-compare - - go-require {{- end}} - require-error {{- end}} diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go index b8c10e430cd..9942391047a 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go @@ -291,7 +291,7 @@ func TestInformerNeverStarts(t *testing.T) { go func() { defer wg.Done() stopReason := myController.Run(testContext) - if !errors.Is(stopReason, context.Canceled) { + if !errors.Is(stopReason, context.DeadlineExceeded) { t.Errorf("expected error to be context.Canceled, but got: %v", stopReason) } }()