Appease the errcheck gods

This commit is contained in:
Andrew Morgan 2018-06-11 13:36:32 +01:00
parent cd6cbae702
commit cac8b9d14c

View file

@ -20,6 +20,7 @@ import (
"time"
"github.com/matrix-org/gomatrixserverlib"
log "github.com/sirupsen/logrus"
)
const appserviceEventsSchema = `
@ -106,7 +107,13 @@ func (s *eventsStatements) selectEventsByApplicationServiceID(
if err != nil {
return nil, nil, err
}
defer eventRows.Close() // nolint: errcheck
defer func() {
err = eventRows.Close()
if err != nil {
log.WithError(err).Fatalf("Appservice %s unable to select new events to send",
applicationServiceID)
}
}()
// Iterate through each row and store event contents
for eventRows.Next() {