From db453a186e878fb64a677eeff33a676a07cac4fc Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Sun, 4 Apr 2021 09:17:04 +0100 Subject: [PATCH] golint happifying, round 2 --- bridge/signald/signald.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bridge/signald/signald.go b/bridge/signald/signald.go index 2e327031..175b367a 100644 --- a/bridge/signald/signald.go +++ b/bridge/signald/signald.go @@ -3,9 +3,10 @@ package bsignald import ( "bufio" "encoding/json" + "net" + "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" - "net" ) type JSONCMD map[string]interface{} @@ -79,7 +80,7 @@ type signaldDataMessage struct { } type signaldGroupInfo struct { - AvatarId int64 `json:"avatarId,omitempty"` + AvatarID int64 `json:"avatarId,omitempty"` ID string `json:"groupId,omitempty"` Members json.RawMessage `json:"members,omitempty"` Name string `json:"name,omitempty"` @@ -104,7 +105,7 @@ type signaldGroupV2Info struct { type signaldSendMessage struct { Type string `json:"type,omitempty"` Username string `json:"username,omitempty"` - RecipientGroupId string `json:"recipientGroupId,omitempty"` + RecipientGroupID string `json:"recipientGroupId,omitempty"` MessageBody string `json:"messageBody,omitempty"` } @@ -159,7 +160,9 @@ func (b *Bsignald) Connect() error { r := bufio.NewScanner(s) b.reader = r go b.Listen() - go b.Login() + if err := b.Login(); err != nil { + b.Log.Errorln("Error logging in: ", err.Error()) + } return nil } @@ -337,7 +340,7 @@ func (b *Bsignald) Send(msg config.Message) (string, error) { msgJSON := signaldSendMessage{ Type: "send", Username: b.GetString(cfgNumber), - RecipientGroupId: b.groupid, + RecipientGroupID: b.groupid, MessageBody: msg.Username + msg.Text, }