【发布时间】:2018-05-10 16:29:23
【问题描述】:
有以下代码:
func consumeQueue(ch *amqp.Channel, q_Name string) (chan amqp.Delivery) {
msgs, err := ch.Consume(
q_Name, // queue
"", // consumer
true, // auto-ack
false, // exclusive
false, // no-local
false, // no-wait
nil, // args
)
failOnError(err, "Failed to register a consumer")
return msgs
}
它抛出以下编译时异常:
cannot use msgs (type <-chan amqp.Delivery) as type chan amqp.Delivery in return argument
怎么了?
【问题讨论】: