Check if config is valid JSON

This commit is contained in:
Akbar Rahman 2021-09-01 18:57:21 +01:00
parent 3cadcfbabe
commit 1e53930e8c
Signed by: alvierahman90
GPG Key ID: 20609519444A1269

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())
} }