add error handler

This commit is contained in:
Данил 2022-09-19 02:07:40 +03:00
parent f56f61ba18
commit 89a97fcac3

View file

@ -19,11 +19,15 @@ var SettingsGet = func(w http.ResponseWriter, r *http.Request) {
panic(errQuery) panic(errQuery)
} }
defer query.Close() defer func(query *sql.Rows) {
err := query.Close()
if err != nil {
panic(err)
}
}(query)
var lang string var lang string
var autostart int var autostart, autoupdate int
var autoupdate int
for query.Next() { for query.Next() {
err := query.Scan(&lang, &autostart, &autoupdate) err := query.Scan(&lang, &autostart, &autoupdate)