From c3386ba118b1a0f2ae1a31a9787ea5cb8b68396f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 19 Apr 2018 11:35:52 +0300 Subject: [PATCH] Fix golint issues --- matrix/pushrules/action.go | 5 ++--- ui/messages/parser/parser.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/matrix/pushrules/action.go b/matrix/pushrules/action.go index acb97b9..64dfddd 100644 --- a/matrix/pushrules/action.go +++ b/matrix/pushrules/action.go @@ -128,8 +128,7 @@ func (action *PushAction) MarshalJSON() (raw []byte, err error) { "value": action.Value, } return json.Marshal(&data) - } else { - data := string(action.Action) - return json.Marshal(&data) } + data := string(action.Action) + return json.Marshal(&data) } diff --git a/ui/messages/parser/parser.go b/ui/messages/parser/parser.go index 9c833f5..b114d98 100644 --- a/ui/messages/parser/parser.go +++ b/ui/messages/parser/parser.go @@ -62,10 +62,9 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *gomatrix.Ev if hasFormat && format == "org.matrix.custom.html" { text := ParseHTMLMessage(room, evt, displayname) return messages.NewExpandedTextMessage(evt.ID, evt.Sender, displayname, msgtype, text, ts) - } else { - text, _ := evt.Content["body"].(string) - return messages.NewTextMessage(evt.ID, evt.Sender, displayname, msgtype, text, ts) } + text, _ := evt.Content["body"].(string) + return messages.NewTextMessage(evt.ID, evt.Sender, displayname, msgtype, text, ts) case "m.image": url, _ := evt.Content["url"].(string) data, hs, id, err := matrix.Download(url)