mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2024-12-25 17:53:47 +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…
Add table
Reference in a new issue