Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

how to decode a yaml.Node document ? #993

@ndeloof

Description

@ndeloof

I'm running some custom logic to post-process a yaml document as a plain yaml.Node, which I obtain by :

	var nodes yaml.Node
	if err := decoder.Decode(&nodes); ...

but then I have no way to invoke the actual decoder code.

AFAICT Decoder only access the *parser once by calling parse(). Makes me wonder it would sound correct to refactor this so it relies on some Parser interface, so that one can use:

decoder := &Decoder{
		Parser: customParserProducingNodes(),
	}
decoder.Decode(&myStruct)

would this sound good? Happy to prepare a PR for this purpose

Metadata

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