Skip to content

Use UnmarshalStrict for yaml Unmarshalling #4017

@krasi-georgiev

Description

@krasi-georgiev

The yaml library we are using now support UnmarshalStrict which will return an error for for unknowns, or double definitions
https://godoc.org/gopkg.in/yaml.v2#UnmarshalStrict

After start using UnmarshalStrict CheckOverflow will be no longer needer

func CheckOverflow(m map[string]interface{}, ctx string) error {
if len(m) > 0 {
var keys []string
for k := range m {
keys = append(keys, k)
}
return fmt.Errorf("unknown fields in %s: %s", ctx, strings.Join(keys, ", "))
}
return nil
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions