From 4f7c3494a891d091d4c7d465f7eb66a0550dc3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 6 Mar 2024 14:54:45 +0000 Subject: [PATCH] Enable all govet lints besides fieldalignment/shadow shadow would need to ignore shadowing `err`, & fieldalignment raises many warnings which can be evaluated in a future PR to reduce memory footprint --- flow/.golangci.yml | 5 +++++ flow/cmd/handler.go | 4 ++-- flow/cmd/peer_data.go | 4 ++-- flow/connectors/clickhouse/qrep_avro_sync.go | 3 --- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/flow/.golangci.yml b/flow/.golangci.yml index 50582063f1..1b03b3c3a3 100644 --- a/flow/.golangci.yml +++ b/flow/.golangci.yml @@ -57,6 +57,11 @@ linters-settings: settings: hugeParam: sizeThreshold: 512 + govet: + enable-all: true + disable: + - fieldalignment + - shadow stylecheck: checks: - all diff --git a/flow/cmd/handler.go b/flow/cmd/handler.go index f4a7a7cc62..554e177dc1 100644 --- a/flow/cmd/handler.go +++ b/flow/cmd/handler.go @@ -373,8 +373,8 @@ func (h *FlowRequestHandler) ShutdownFlow( } if req.RemoveFlowEntry { - delErr := h.removeFlowEntryInCatalog(ctx, req.FlowJobName) - if delErr != nil { + err := h.removeFlowEntryInCatalog(ctx, req.FlowJobName) + if err != nil { slog.Error("unable to remove flow job entry", slog.String(string(shared.FlowNameKey), req.FlowJobName), slog.Any("error", err), diff --git a/flow/cmd/peer_data.go b/flow/cmd/peer_data.go index f4846280ed..7ec28329e2 100644 --- a/flow/cmd/peer_data.go +++ b/flow/cmd/peer_data.go @@ -23,9 +23,9 @@ func (h *FlowRequestHandler) getPGPeerConfig(ctx context.Context, peerName strin return nil, err } - unmarshalErr := proto.Unmarshal(pgPeerOptions, &pgPeerConfig) + err = proto.Unmarshal(pgPeerOptions, &pgPeerConfig) if err != nil { - return nil, unmarshalErr + return nil, err } return &pgPeerConfig, nil diff --git a/flow/connectors/clickhouse/qrep_avro_sync.go b/flow/connectors/clickhouse/qrep_avro_sync.go index bf119143cc..f4631ca4f4 100644 --- a/flow/connectors/clickhouse/qrep_avro_sync.go +++ b/flow/connectors/clickhouse/qrep_avro_sync.go @@ -43,9 +43,6 @@ func (s *ClickhouseAvroSyncMethod) CopyStageToDestination(ctx context.Context, a avroFileUrl := fmt.Sprintf("https://%s.s3.%s.amazonaws.com/%s", s3o.Bucket, s.connector.creds.Region, avroFile.FilePath) - if err != nil { - return err - } //nolint:gosec query := fmt.Sprintf("INSERT INTO %s SELECT * FROM s3('%s','%s','%s', 'Avro')", s.config.DestinationTableIdentifier, avroFileUrl,