When decoding
to a yaml.Node, the result is a single document which contains the comment attached to the non-empty map.
I prepared a fix for this in go-yaml/yaml some time ago (it's already 4.5 years: go-yaml/yaml#690). I can re-do the PR here if there's interest in contributions, or feel free to salvage that PR yourself if you want :)