Check if config is valid JSON

This commit is contained in:
2021-09-01 18:57:21 +01:00
parent 3cadcfbabe
commit 1e53930e8c

View File

@@ -37,7 +37,10 @@ func main() {
panic(err.Error()) panic(err.Error())
} }
json.Unmarshal(raw_config, &c) if err := json.Unmarshal(raw_config, &c); err != nil {
panic(err.Error())
}
if err := c.Validate(); err != nil { if err := c.Validate(); err != nil {
panic(err.Error()) panic(err.Error())
} }