Fix golang errors about unused variables

This commit is contained in:
Peter Stuifzand 2018-02-19 21:34:39 +01:00
parent f5d791c05e
commit 448903d711

View File

@ -157,7 +157,7 @@ func (b *memoryBackend) TimelineGet(after, before, channel string) microsub.Time
// Filter items with "published" date
for _, r := range results {
if p, e := r["published"]; e {
if _, e := r["published"]; e {
items = append(items, r)
}
}
@ -165,8 +165,8 @@ func (b *memoryBackend) TimelineGet(after, before, channel string) microsub.Time
}
sort.Slice(items, func(a, b int) bool {
timeA, okA := items[a]["published"].(string)
timeB, okB := items[b]["published"].(string)
timeA, _ := items[a]["published"].(string)
timeB, _ := items[b]["published"].(string)
return strings.Compare(timeA, timeB) > 0
})