Skip to content

UnmarshalStrict() doesn't error on duplicate keys #284

Closed
@aeijdenberg

Description

I spent yesterday afternoon tracking down a bug in our Concourse configuration whereby the root cause was a YAML file containing:

resource_types:
- name: foo
- name: bar

... hundreds of unrelated lines later ...

resource_types:
- name: baz

where the final resource_types effectively deleted the first.

I thought it would be within the spirit of what UnmarshalStrict() sounds like it should do, if it would return an error if a key is attempted to be set in a map (or struct) that already has value.

PR forthcoming for your consideration...

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions