mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-11-05 06:03:57 +03:00
add error handler
This commit is contained in:
parent
f56f61ba18
commit
89a97fcac3
1 changed files with 7 additions and 3 deletions
|
@ -19,11 +19,15 @@ var SettingsGet = func(w http.ResponseWriter, r *http.Request) {
|
|||
panic(errQuery)
|
||||
}
|
||||
|
||||
defer query.Close()
|
||||
defer func(query *sql.Rows) {
|
||||
err := query.Close()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}(query)
|
||||
|
||||
var lang string
|
||||
var autostart int
|
||||
var autoupdate int
|
||||
var autostart, autoupdate int
|
||||
|
||||
for query.Next() {
|
||||
err := query.Scan(&lang, &autostart, &autoupdate)
|
||||
|
|
Loading…
Reference in a new issue