From 62bdaec511937201fe298b906bfa923390b3ff70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Erbrech?= Date: Thu, 23 Mar 2023 13:14:13 +1100 Subject: [PATCH] typos (#120) --- v2/managedsettling.go | 4 ++-- v2/managedsettling_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/v2/managedsettling.go b/v2/managedsettling.go index a52b0366..049e6d81 100644 --- a/v2/managedsettling.go +++ b/v2/managedsettling.go @@ -77,11 +77,11 @@ type ManagedSettlingOptions struct { // and the RetryDecision decides to retry the message. // The handler will sleep for the time calculated by the delayStrategy before Abandoning the message. RetryDelayStrategy RetryDelayStrategy - // OnAbandoned is invoked when the handler returns an error. It is invoked after the message is abandoned or deadlettered. + // OnAbandoned is invoked when the handler returns an error. It is invoked after the message is abandoned. OnAbandoned func(context.Context, *azservicebus.ReceivedMessage, error) // OnDeadLettered is invoked after the ManagedSettling dead-letters a message. // this occurs when the RetryDecision.CanRetry implementation returns false following an error returned by the handler - // It is invoked after the message is abandoned or deadlettered. + // It is invoked after the message is dead-lettered. OnDeadLettered func(context.Context, *azservicebus.ReceivedMessage, error) // OnCompleted is a func that is invoked when the handler does not return any error. it is invoked after the message is completed. OnCompleted func(context.Context, *azservicebus.ReceivedMessage) diff --git a/v2/managedsettling_test.go b/v2/managedsettling_test.go index 127b5400..dc7d2a50 100644 --- a/v2/managedsettling_test.go +++ b/v2/managedsettling_test.go @@ -13,7 +13,7 @@ import ( type fakeSettler struct { abandoned bool completed bool - conpleteErr error + completeErr error deadlettered bool deadletterOptions *azservicebus.DeadLetterOptions defered bool @@ -27,7 +27,7 @@ func (f *fakeSettler) AbandonMessage(ctx context.Context, message *azservicebus. func (f *fakeSettler) CompleteMessage(ctx context.Context, message *azservicebus.ReceivedMessage, options *azservicebus.CompleteMessageOptions) error { f.completed = true - return f.conpleteErr + return f.completeErr } func (f *fakeSettler) DeadLetterMessage(ctx context.Context, message *azservicebus.ReceivedMessage, options *azservicebus.DeadLetterOptions) error { @@ -104,7 +104,7 @@ func TestManagedSettler_Handle(t *testing.T) { { name: "complete returns error triggers abandon hook", hooks: &hooks{}, - settler: fakeSettler{conpleteErr: fmt.Errorf("failed to complete msg")}, + settler: fakeSettler{completeErr: fmt.Errorf("failed to complete msg")}, handlerResponse: nil, // handler succeeds msg: &azservicebus.ReceivedMessage{}, expectation: func(t *testing.T, hooks *hooks, settler *fakeSettler) {