use UnmarshalStrict for monitoring config parsing
UnmarshalStrict returns error when encountering unknown field from yaml.
It's a good way to catch mis-spelt and unsupported field names.
@@ -118,7 +118,7 @@ func ParseYaml(url string) (*Config, error) {
func newConfig(text []byte) (*Config, error) {
file := new(Config)
- if err := yaml.Unmarshal(text, &file); err != nil {
+ if err := yaml.UnmarshalStrict(text, &file); err != nil {
return file, err
}
return file, nil
