diff --git a/consume.go b/consume.go index f23f18c..1c22504 100644 --- a/consume.go +++ b/consume.go @@ -189,31 +189,23 @@ func WithConsumeOptionsBindingExchangeKind(kind string) func(*ConsumeOptions) { } // WithConsumeOptionsBindingExchangeDurable returns a function that sets the binding exchange durable flag -func WithConsumeOptionsBindingExchangeDurable() func(*ConsumeOptions) { - return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).Durable = true - } +func WithConsumeOptionsBindingExchangeDurable(options *ConsumeOptions) { + getBindingExchangeOptionsOrSetDefault(options).Durable = true } // WithConsumeOptionsBindingExchangeAutoDelete returns a function that sets the binding exchange autoDelete flag -func WithConsumeOptionsBindingExchangeAutoDelete() func(*ConsumeOptions) { - return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).AutoDelete = true - } +func WithConsumeOptionsBindingExchangeAutoDelete(options *ConsumeOptions) { + getBindingExchangeOptionsOrSetDefault(options).AutoDelete = true } // WithConsumeOptionsBindingExchangeInternal returns a function that sets the binding exchange internal flag -func WithConsumeOptionsBindingExchangeInternal() func(*ConsumeOptions) { - return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).Internal = true - } +func WithConsumeOptionsBindingExchangeInternal(options *ConsumeOptions) { + getBindingExchangeOptionsOrSetDefault(options).Internal = true } // WithConsumeOptionsBindingExchangeNoWait returns a function that sets the binding exchange noWait flag -func WithConsumeOptionsBindingExchangeNoWait() func(*ConsumeOptions) { - return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).NoWait = true - } +func WithConsumeOptionsBindingExchangeNoWait(options *ConsumeOptions) { + getBindingExchangeOptionsOrSetDefault(options).NoWait = true } // WithConsumeOptionsBindingExchangeArgs returns a function that sets the binding exchange arguments that are specific to the server's implementation of the exchange diff --git a/examples/consumer/main.go b/examples/consumer/main.go index 4569a3d..93c906d 100644 --- a/examples/consumer/main.go +++ b/examples/consumer/main.go @@ -27,7 +27,7 @@ func main() { rabbitmq.WithConsumeOptionsQuorum, rabbitmq.WithConsumeOptionsBindingExchangeName("events"), rabbitmq.WithConsumeOptionsBindingExchangeKind("topic"), - rabbitmq.WithConsumeOptionsBindingExchangeDurable(true), + rabbitmq.WithConsumeOptionsBindingExchangeDurable, ) if err != nil { log.Fatal(err)