Make vet happy
This commit is contained in:
parent
49ac4746fc
commit
6bb1de43e3
|
@ -8,22 +8,22 @@ import (
|
|||
|
||||
func startReceiver(ch *sdk.Channel) {
|
||||
if _, err := ch.Subscribe(func(m *sdk.Msg) {
|
||||
log.Println("[DEBUG] Got message: %v", m)
|
||||
log.Printf("[DEBUG] Got message: %v", m)
|
||||
rawmsg, ok := m.Properties.(*sdk.PublishMsg)
|
||||
if !ok {
|
||||
log.Println("[ERROR] Wrong message props type received: %T", m.Properties)
|
||||
log.Printf("[ERROR] Wrong message props type received: %T", m.Properties)
|
||||
return
|
||||
}
|
||||
msg := Msg(rawmsg.Text)
|
||||
if msg.IsRequest() {
|
||||
counter, err := msg.Counter()
|
||||
if err != nil {
|
||||
log.Println("[ERROR] Can't extract counter: %v", err)
|
||||
log.Printf("[ERROR] Can't extract counter: %v", err)
|
||||
}
|
||||
go func(counter int) {
|
||||
var body = NewResponseMsg(counter)
|
||||
if err := ch.Publish(string(body)); err != nil {
|
||||
log.Println("[ERROR] Can't send response: %v", err)
|
||||
log.Printf("[ERROR] Can't send response: %v", err)
|
||||
}
|
||||
}(counter)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue