9
0
mirror of https://github.com/Lomanic/presence-button-web synced 2024-11-22 05:27:29 +00:00

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

View File

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