golint happifying, round 2

pull/1433/head
Peter Molnar 4 years ago
parent 14a83e08cb
commit db453a186e

@ -3,9 +3,10 @@ package bsignald
import ( import (
"bufio" "bufio"
"encoding/json" "encoding/json"
"net"
"github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/bridge/config"
"net"
) )
type JSONCMD map[string]interface{} type JSONCMD map[string]interface{}
@ -79,7 +80,7 @@ type signaldDataMessage struct {
} }
type signaldGroupInfo struct { type signaldGroupInfo struct {
AvatarId int64 `json:"avatarId,omitempty"` AvatarID int64 `json:"avatarId,omitempty"`
ID string `json:"groupId,omitempty"` ID string `json:"groupId,omitempty"`
Members json.RawMessage `json:"members,omitempty"` Members json.RawMessage `json:"members,omitempty"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
@ -104,7 +105,7 @@ type signaldGroupV2Info struct {
type signaldSendMessage struct { type signaldSendMessage struct {
Type string `json:"type,omitempty"` Type string `json:"type,omitempty"`
Username string `json:"username,omitempty"` Username string `json:"username,omitempty"`
RecipientGroupId string `json:"recipientGroupId,omitempty"` RecipientGroupID string `json:"recipientGroupId,omitempty"`
MessageBody string `json:"messageBody,omitempty"` MessageBody string `json:"messageBody,omitempty"`
} }
@ -159,7 +160,9 @@ func (b *Bsignald) Connect() error {
r := bufio.NewScanner(s) r := bufio.NewScanner(s)
b.reader = r b.reader = r
go b.Listen() go b.Listen()
go b.Login() if err := b.Login(); err != nil {
b.Log.Errorln("Error logging in: ", err.Error())
}
return nil return nil
} }
@ -337,7 +340,7 @@ func (b *Bsignald) Send(msg config.Message) (string, error) {
msgJSON := signaldSendMessage{ msgJSON := signaldSendMessage{
Type: "send", Type: "send",
Username: b.GetString(cfgNumber), Username: b.GetString(cfgNumber),
RecipientGroupId: b.groupid, RecipientGroupID: b.groupid,
MessageBody: msg.Username + msg.Text, MessageBody: msg.Username + msg.Text,
} }

Loading…
Cancel
Save