Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gastrodon opened this issue Dec 14, 2022 · 1 comment
Open

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

gastrodon opened this issue Dec 14, 2022 · 1 comment

Comments

@gastrodon
Copy link

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 )

@gastrodon
Copy link
Author

pr'd #181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant