go-yaml / yaml

YAML support for the Go language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to use YAML v1.2 octal syntax only

mx-psi opened this issue · comments

As stated on the README compatibility section yaml.v3,

Octals encode and decode as 0777 per YAML 1.1, rather than 0o777 as specified in YAML 1.2, because most parsers still use the old format. Octals in the 0o777 format are supported though, so new files work.

This can be confusing for end users (e.g. see open-telemetry/opentelemetry-collector/issues/8565) so it would be great to have an option to make the parser only support the new octal syntax (or maybe even an option to be strictly YAML 1.2 compliant?)