dendrite/common
Kiril Vladimiroff 59465746bc
Always defer *sql.Rows.Close and consult with Err
database/sql.Rows.Next() makes sure to call Close only after exhausting
result rows which would NOT happen when returning early from a bad Scan.
Close being idempotent makes it a great candidate to get always deferred
regardless of what happens later on the result set.

This change also makes sure call Err() after exhausting Next() and
propagate non-nil results from it as the documentation advises.

Closes #764

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>
2020-02-06 11:27:24 +02:00
..
basecomponent Store our own keys in the keydb (#853) 2020-01-25 14:12:52 +00:00
config patch dendrite microservices with bind config (#795) 2019-10-02 10:29:27 +01:00
http use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
keydb Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
test Add AppService to test config and bind addrs (#800) 2019-10-04 17:08:00 +01:00
transactions Replace deprecated prometheus.InstrumentHandler and unsafe time.Ticker 2019-12-17 16:47:45 +00:00
consumers.go use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
eventcontent.go Replace event content types with ones in gomatrixserverlib (#785) 2019-08-16 01:45:11 +08:00
events.go use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
httpapi.go Replace deprecated prometheus.InstrumentHandler and unsafe time.Ticker 2019-12-17 16:47:45 +00:00
log.go Add filepath and function name to log output (#755) 2019-07-24 12:44:05 +08:00
partition_offset_table.go Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
routing.go Encode URLs properly (#728) 2019-07-03 16:38:50 +01:00
sql.go use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
types.go Implement profile retrieval over federation (#726) 2019-08-07 00:02:12 +08:00