From b1fd72ef4bca45664896ea6a28df614fa9b1f0bb Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 14 Sep 2022 10:25:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E9=98=9F?= =?UTF-8?q?=E5=88=97=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rabbitmq.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rabbitmq.go b/rabbitmq.go index c1630e3..5bf4239 100644 --- a/rabbitmq.go +++ b/rabbitmq.go @@ -145,6 +145,9 @@ func (r *rabbitmq) Consume(queueName string, autoAck bool, prefetchCount int, ca for { select { case d := <-msgs: + if d.Acknowledger == nil { + return errors.New("delivery not initialized") + } callback(d) case <-closeChan: // 连接断开