Properly report JSON decoding error in init

This commit is contained in:
Lomanic 2020-10-24 19:09:08 +02:00
parent 006ab04b8c
commit 32afdde63d
1 changed files with 1 additions and 2 deletions

View File

@ -105,8 +105,7 @@ func init() {
if err != nil && !os.IsNotExist(err) {
panic(err)
}
d := json.NewDecoder(db)
d.Decode(&status)
err = json.NewDecoder(db).Decode(&status)
if err != nil {
fmt.Println("error unmarshalling db:", err)
}