mirror of
https://github.com/alvierahman90/gohookr.git
synced 2024-11-21 22:09:53 +00:00
Check if config is valid JSON
This commit is contained in:
parent
3cadcfbabe
commit
1e53930e8c
5
main.go
5
main.go
@ -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())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user