From 9075307bbe9b5c3b63727a630367c64fe9263fb7 Mon Sep 17 00:00:00 2001 From: William Van Hevelingen Date: Mon, 31 Jan 2022 23:40:13 -0800 Subject: [PATCH] chore: Update golangci-lint to 1.44.0 (#1578) This commit updates golangci-lint and removes the interfacer check because it was marked as deprecated and will be removed. See https://github.com/golangci/golangci-lint/issues/541 for more information. Signed-off-by: William Van Hevelingen Signed-off-by: Julie Vogelman --- .golangci.yml | 1 - Makefile | 2 +- eventsources/sources/amqp/start.go | 3 ++- eventsources/sources/amqp/start_test.go | 3 ++- eventsources/sources/kafka/start.go | 2 +- sensors/dependencies/filter_test.go | 1 - test/stress/main.go | 21 ++++----------------- 7 files changed, 10 insertions(+), 23 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2d3b24050a..f78a49086b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -19,7 +19,6 @@ linters: - gosimple - govet - ineffassign - - interfacer - misspell - nakedret - rowserrcheck diff --git a/Makefile b/Makefile index f746d13b7c..6c51fc8db7 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ start: image kubectl -n argo-events wait --for=condition=Ready --timeout 60s pod --all $(GOPATH)/bin/golangci-lint: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.42.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.44.0 .PHONY: lint lint: $(GOPATH)/bin/golangci-lint diff --git a/eventsources/sources/amqp/start.go b/eventsources/sources/amqp/start.go index 5c5af221d1..74dbe978bc 100644 --- a/eventsources/sources/amqp/start.go +++ b/eventsources/sources/amqp/start.go @@ -19,9 +19,10 @@ package amqp import ( "context" "encoding/json" - "sigs.k8s.io/yaml" "time" + "sigs.k8s.io/yaml" + "github.com/pkg/errors" amqplib "github.com/streadway/amqp" "go.uber.org/zap" diff --git a/eventsources/sources/amqp/start_test.go b/eventsources/sources/amqp/start_test.go index 78b8145ec7..5381182618 100644 --- a/eventsources/sources/amqp/start_test.go +++ b/eventsources/sources/amqp/start_test.go @@ -17,8 +17,9 @@ limitations under the License. package amqp import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestParseYamlTable(t *testing.T) { diff --git a/eventsources/sources/kafka/start.go b/eventsources/sources/kafka/start.go index 14bed28abc..486921a3ce 100644 --- a/eventsources/sources/kafka/start.go +++ b/eventsources/sources/kafka/start.go @@ -261,7 +261,7 @@ func (el *EventListener) partitionConsumer(ctx context.Context, log *zap.Sugared } } -func getSaramaConfig(kafkaEventSource *v1alpha1.KafkaEventSource, log *zap.SugaredLogger) (*sarama.Config, error) { //nolint:interfacer +func getSaramaConfig(kafkaEventSource *v1alpha1.KafkaEventSource, log *zap.SugaredLogger) (*sarama.Config, error) { config := sarama.NewConfig() if kafkaEventSource.Version == "" { diff --git a/sensors/dependencies/filter_test.go b/sensors/dependencies/filter_test.go index 7f8caeb9ac..94024ba598 100644 --- a/sensors/dependencies/filter_test.go +++ b/sensors/dependencies/filter_test.go @@ -922,5 +922,4 @@ func TestFilter(t *testing.T) { assert.Error(t, err) assert.False(t, pass) }) - } diff --git a/test/stress/main.go b/test/stress/main.go index 23c6a5e792..74b0905e44 100644 --- a/test/stress/main.go +++ b/test/stress/main.go @@ -277,23 +277,10 @@ func (o *options) runTesting(ctx context.Context, eventSourceName, sensorName st return fmt.Errorf("no pod found for sensor %s", sensorName) } - successActionReg, err := regexp.Compile(logTriggerActionSuccessful) - if err != nil { - return fmt.Errorf("failed to compile regex for sensor success pattern: %v", err) - } - failureActionReg, err := regexp.Compile(logTriggerActionFailed) - if err != nil { - return fmt.Errorf("failed to compile regex for sensor failure pattern: %v", err) - } - - successEventReg, err := regexp.Compile(logEventSuccessful) - if err != nil { - return fmt.Errorf("failed to compile regex for event source success pattern: %v", err) - } - failureEventReg, err := regexp.Compile(logEventFailed) - if err != nil { - return fmt.Errorf("failed to compile regex for event source failure pattern: %v", err) - } + successActionReg := regexp.MustCompile(logTriggerActionSuccessful) + failureActionReg := regexp.MustCompile(logTriggerActionFailed) + successEventReg := regexp.MustCompile(logEventSuccessful) + failureEventReg := regexp.MustCompile(logEventFailed) fmt.Printf(` *********************************************************