From 6d26faf3b288e2241340f0b93673ae8cbc3abe61 Mon Sep 17 00:00:00 2001 From: Dmitry Ponomarev Date: Mon, 14 Nov 2022 20:21:52 +0100 Subject: [PATCH] Fix lint errors --- receiver_func.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/receiver_func.go b/receiver_func.go index 8e0ed8d..2b6c06e 100644 --- a/receiver_func.go +++ b/receiver_func.go @@ -17,7 +17,12 @@ func ReceiverFrom(handler any) Receiver { case Receiver: return h case func() error: - return FuncReceiver(func(msg Message) error { h(); return msg.Ack() }) + return FuncReceiver(func(msg Message) error { + if err := h(); err != nil { + return err + } + return msg.Ack() + }) case func(msg Message) error: return FuncReceiver(h) case func(ctx context.Context, msg Message) error: