Skip to content

Commit

Permalink
Enable all govet lints besides fieldalignment/shadow (#1441)
Browse files Browse the repository at this point in the history
shadow would need to ignore shadowing `err`,
& fieldalignment raises many warnings which can be evaluated in a future PR to reduce memory footprint
  • Loading branch information
serprex authored Mar 6, 2024
1 parent 0a32419 commit f8f8d64
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions flow/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ linters-settings:
settings:
hugeParam:
sizeThreshold: 512
govet:
enable-all: true
disable:
- fieldalignment
- shadow
stylecheck:
checks:
- all
Expand Down
4 changes: 2 additions & 2 deletions flow/cmd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions flow/cmd/peer_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions flow/connectors/clickhouse/qrep_avro_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f8f8d64

Please sign in to comment.