I found this line:
return (<-chan Delivery)(deliveries), nil
https://github.com/streadway/amqp/blob/master/channel.go#L1089
What does it do? Why the double parentheses?
I found this line:
return (<-chan Delivery)(deliveries), nil
https://github.com/streadway/amqp/blob/master/channel.go#L1089
What does it do? Why the double parentheses?
It's a type conversion. In your case, it converts chan Delivery
(two-way channel of Delivery
values) to <-chan Delivery
(receive-only channel of Delivery
values).