Skip to content

encoding/yaml: Support for encoding tags #2316

@uhthomas

Description

@uhthomas

Is your feature request related to a problem? Please describe.

There are some situations where a yaml tag is required. (encoding/yaml).Marshal does not support encoding tags and makes this impossible.

It looks like the authors of the original encoder were aware this may be desirable.

// TODO: use cue.Value and support attributes for setting YAML tags.

Describe the solution you'd like

Support encoding tags with an attribute.

import "encoding/yaml"

yaml.Marshal({
    some_key: "some value" @yaml.Tag("some tag")
})

Describe alternatives you've considered
Not sure.

Additional context

Maybe:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions