Skip to content

Add support for decoding into structs with a custom tag #148

@gastrodon

Description

@gastrodon

I'd like a feature for a project that I'm working on to be able to do something like gocty.FromCtyValue, but for a struct with field tags of a kind other than cty:"". Is this within the scope of this project / compatible with design goals?

I've taken a stab at it here - that branch updates func structTagIndices to take a tag string instead of always using cty, and adds a new function func FromCtyValueTagged that takes a new parameter tag string

My project uses this function to decode values into structs that are provided by a plugin and everything seems to work ( +cty tests pass )

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