style(eda): apply go fix to the ledger coordinator test
This commit is contained in:
1 file changed
+3
-4
@@ -3,6 +3,7 @@ package playbook
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
"slices"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/samcharles93/archie-core/internal/domain/storecontract"
|
"github.com/samcharles93/archie-core/internal/domain/storecontract"
|
||||||
@@ -25,10 +26,8 @@ type playbookRecord struct {
|
|||||||
|
|
||||||
func (f *fakePlaybookLedger) RecordPlaybookDispatch(ctx context.Context, playbookID, playbookVersion, eventID, actionID string) error {
|
func (f *fakePlaybookLedger) RecordPlaybookDispatch(ctx context.Context, playbookID, playbookVersion, eventID, actionID string) error {
|
||||||
key := playbookRecord{playbookID, playbookVersion, eventID, actionID}
|
key := playbookRecord{playbookID, playbookVersion, eventID, actionID}
|
||||||
for _, r := range f.records {
|
if slices.Contains(f.records, key) {
|
||||||
if r == key {
|
return storecontract.ErrAlreadyDispatched
|
||||||
return storecontract.ErrAlreadyDispatched
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
f.records = append(f.records, key)
|
f.records = append(f.records, key)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user