Skip to content

Commit

Permalink
a few minor lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed May 6, 2021
1 parent ee820c7 commit 5e3fcf6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion server/datamodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ func ErrUserNotFoundReply(msg *ClientComMessage, ts time.Time) *ServerComMessage
return ErrUserNotFound(msg.Id, msg.Original, ts, msg.Timestamp)
}

// ErrNotFoundExplicitTs is an error for missing objects other than user or topic.
// ErrNotFound is an error for missing objects other than user or topic.
func ErrNotFound(id, topic string, ts time.Time) *ServerComMessage {
return ErrNotFoundExplicitTs(id, topic, ts, ts)
}
Expand Down
18 changes: 9 additions & 9 deletions server/drafty/drafty.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ func Preview(content interface{}, length int) (string, error) {
}

// Allocate space for copying styles and entities.
var preview_fmt []map[string]interface{}
var preview_ent []map[string]interface{}
var previewFmt []map[string]interface{}
var previewEnt []map[string]interface{}
if len(entRefs) > 0 {
preview_ent = make([]map[string]interface{}, len(entRefs))
previewEnt = make([]map[string]interface{}, len(entRefs))
}
for _, old := range styles {
style := span{at: old.at, end: old.end}
Expand All @@ -195,21 +195,21 @@ func Preview(content interface{}, length int) (string, error) {
} else if old.key >= 0 && len(ent) > old.key {
if key, ok := entRefs[old.key]; ok {
style.key = key
preview_ent[style.key] = copyLight(ent[old.key])
previewEnt[style.key] = copyLight(ent[old.key])
} else {
continue
}
} else {
continue
}
preview_fmt = append(preview_fmt, style.toMap())
previewFmt = append(previewFmt, style.toMap())
}

if len(preview_fmt) > 0 {
preview["fmt"] = preview_fmt
if len(previewFmt) > 0 {
preview["fmt"] = previewFmt
}
if len(preview_ent) > 0 {
preview["ent"] = preview_ent
if len(previewEnt) > 0 {
preview["ent"] = previewEnt
}
}

Expand Down
2 changes: 1 addition & 1 deletion server/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
ActSub = "sub"
)

// Maximum length of push payload in multibyte characters.
// MaxPayloadLength is the maximum length of push payload in multibyte characters.
const MaxPayloadLength = 128

// Recipient is a user targeted by the push.
Expand Down

0 comments on commit 5e3fcf6

Please sign in to comment.