Make vet happy

This commit is contained in:
Ivan Danyliuk 2018-06-28 13:48:36 +02:00
parent 49ac4746fc
commit 6bb1de43e3
No known key found for this signature in database
GPG Key ID: 97ED33CE024E1DBF
1 changed files with 4 additions and 4 deletions

View File

@ -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)
}