You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @goccy , I stumbled on the same problem. For my better understanding of the suitability of go-yaml, could you please give us your idea? That is, do you consider this a bug or expected behavior? Thanks!
Checking duplicates affects performance (because the parser needs to remember the previous keys). So I'm not sure this check is needed as the default behavior. In the case, adding some opt-in/opt-out check may be suitable to control the trade off.
YAML spec says at 3.2.1.1:
So keys in mappings MUST be unique. This is different from JSON spec where keys SHOULD be unique.
To conform the YAML spec, any YAML parser should cause parse error on duplicate keys. However this library does not cause a parse error.
Here is a link to playground: https://play.golang.org/p/xog5p3vkQFj
The text was updated successfully, but these errors were encountered: