@@ -38,12 +38,12 @@ func NewWorker(opts ...Option) *Worker {
38
38
39
39
w .conn , err = amqp .Dial (w .opts .addr )
40
40
if err != nil {
41
- w .opts .logger .Fatal ("can't connect rabbitmq:" , err )
41
+ w .opts .logger .Fatal ("can't connect rabbitmq: " , err )
42
42
}
43
43
44
44
w .channel , err = w .conn .Channel ()
45
45
if err != nil {
46
- w .opts .logger .Fatal ("can't setup channel:" , err )
46
+ w .opts .logger .Fatal ("can't setup channel: " , err )
47
47
}
48
48
49
49
if err := w .channel .ExchangeDeclare (
@@ -55,7 +55,7 @@ func NewWorker(opts ...Option) *Worker {
55
55
false , // noWait
56
56
nil , // arguments
57
57
); err != nil {
58
- w .opts .logger .Fatal ("can't declares an exchange:" , err )
58
+ w .opts .logger .Fatal ("can't declares an exchange: " , err )
59
59
}
60
60
61
61
return w
@@ -77,7 +77,7 @@ func (w *Worker) startConsumer() (err error) {
77
77
}
78
78
79
79
if err := w .channel .QueueBind (q .Name , w .opts .routingKey , w .opts .exchangeName , false , nil ); err != nil {
80
- w .opts .logger .Error ("cannot consume without a binding to exchange:" , err )
80
+ w .opts .logger .Error ("cannot consume without a binding to exchange: " , err )
81
81
return
82
82
}
83
83
@@ -92,7 +92,7 @@ func (w *Worker) startConsumer() (err error) {
92
92
)
93
93
94
94
if err != nil {
95
- w .opts .logger .Error ("cannot consume from:" , q .Name , err )
95
+ w .opts .logger .Error ("cannot consume from: " , q .Name , err )
96
96
}
97
97
})
98
98
@@ -166,10 +166,10 @@ func (w *Worker) Shutdown() (err error) {
166
166
w .stopOnce .Do (func () {
167
167
close (w .stop )
168
168
if err = w .channel .Cancel (w .opts .tag , true ); err != nil {
169
- w .opts .logger .Error ("consumer cancel failed:" , err )
169
+ w .opts .logger .Error ("consumer cancel failed: " , err )
170
170
}
171
171
if err = w .conn .Close (); err != nil {
172
- w .opts .logger .Error ("AMQP connection close error:" , err )
172
+ w .opts .logger .Error ("AMQP connection close error: " , err )
173
173
}
174
174
})
175
175
0 commit comments