From 9d45476c38186b137654d93a8d6a8bd3496d89ac Mon Sep 17 00:00:00 2001 From: Cedric Cordenier Date: Mon, 17 Feb 2025 12:01:53 +0000 Subject: [PATCH] Lint fixes --- core/services/workflows/syncer/workflow_registry.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/services/workflows/syncer/workflow_registry.go b/core/services/workflows/syncer/workflow_registry.go index 21718f99efc..b5da8f58c5b 100644 --- a/core/services/workflows/syncer/workflow_registry.go +++ b/core/services/workflows/syncer/workflow_registry.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "iter" + "strconv" "strings" "sync" "time" @@ -328,18 +329,19 @@ func (w *workflowRegistry) readRegistryEvents(ctx context.Context, don capabilit event := toWorkflowRegistryEventResponse(log.Sequence, log.EventType, w.lggr) - if event.Event.DonID == nil { + switch { + case event.Event.DonID == nil: // event is missing a DonID, so don't filter it out; // it applies to all Dons events = append(events, event) - } else if *event.Event.DonID == don.ID { + case *event.Event.DonID == don.ID: // event has a DonID and matches, so it applies to this DON. events = append(events, event) - } else { + default: // event doesn't match, let's skip it donID := "MISSING_DON_ID" if event.Event.DonID != nil { - donID = fmt.Sprintf("%d", *event.Event.DonID) + donID = strconv.FormatUint(uint64(*event.Event.DonID), 10) } w.lggr.Debugw("event belongs to a different don, skipping...", "don", don.ID, "gotDON", donID) }