From 920b154a410aeb5a55200d7b21363732abff3502 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 20 Sep 2018 01:23:41 +0300 Subject: [PATCH] Format --- format/markdown.go | 2 +- requests.go | 4 ++-- responses.go | 16 ++++++++-------- userids.go | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/format/markdown.go b/format/markdown.go index 8ec6d8fc..3bfa1dcf 100644 --- a/format/markdown.go +++ b/format/markdown.go @@ -2,8 +2,8 @@ package format import ( "gopkg.in/russross/blackfriday.v2" - "strings" "maunium.net/go/gomatrix" + "strings" ) func RenderMarkdown(text string) gomatrix.Content { diff --git a/requests.go b/requests.go index d8e10a6d..81ff361c 100644 --- a/requests.go +++ b/requests.go @@ -31,7 +31,7 @@ type ReqCreateRoom struct { Invite []string `json:"invite,omitempty"` Invite3PID []ReqInvite3PID `json:"invite_3pid,omitempty"` CreationContent map[string]interface{} `json:"creation_content,omitempty"` - InitialState []*Event `json:"initial_state,omitempty"` + InitialState []*Event `json:"initial_state,omitempty"` Preset string `json:"preset,omitempty"` IsDirect bool `json:"is_direct,omitempty"` } @@ -79,4 +79,4 @@ type ReqTyping struct { type ReqPresence struct { Presence string `json:"presence"` -} \ No newline at end of file +} diff --git a/responses.go b/responses.go index 9524d624..c5f6eebf 100644 --- a/responses.go +++ b/responses.go @@ -63,9 +63,9 @@ type RespJoinedMembers struct { // RespMessages is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-messages type RespMessages struct { - Start string `json:"start"` + Start string `json:"start"` Chunk []*Event `json:"chunk"` - End string `json:"end"` + End string `json:"end"` } // RespSendEvent is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid @@ -146,8 +146,8 @@ type RespSync struct { } `json:"state"` Timeline struct { Events []*Event `json:"events"` - Limited bool `json:"limited"` - PrevBatch string `json:"prev_batch"` + Limited bool `json:"limited"` + PrevBatch string `json:"prev_batch"` } `json:"timeline"` } `json:"leave"` Join map[string]struct { @@ -156,14 +156,14 @@ type RespSync struct { } `json:"state"` Timeline struct { Events []*Event `json:"events"` - Limited bool `json:"limited"` - PrevBatch string `json:"prev_batch"` + Limited bool `json:"limited"` + PrevBatch string `json:"prev_batch"` } `json:"timeline"` Ephemeral struct { - Events []*Event `json:"events"` + Events []*Event `json:"events"` } `json:"ephemeral"` AccountData struct { - Events []*Event `json:"events"` + Events []*Event `json:"events"` } `json:"account_data"` } `json:"join"` Invite map[string]struct { diff --git a/userids.go b/userids.go index 23e78072..70002c5b 100644 --- a/userids.go +++ b/userids.go @@ -125,6 +125,6 @@ func ExtractUserLocalpart(userID string) (string, error) { } return strings.TrimPrefix( strings.SplitN(userID, ":", 2)[0], // @foo:bar:8448 => [ "@foo", "bar:8448" ] - "@", // remove "@" prefix + "@", // remove "@" prefix ), nil }