-
Notifications
You must be signed in to change notification settings - Fork 13
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
Mapstructure tags are ignored on slice struct items #19
Comments
I think something needs to be done to handle slices/arrays here: https://github.com/go-viper/mapstructure/blob/main/mapstructure.go#L1008 I'll try to look into it but will probably need some help, the code is hard |
Hm, that looks like a bug. I don't have a solution from the top of my head. I'll try to look into it when I find the time. |
This is related to mitchellh#249. PR mitchellh#314 has a solution. It would be great if the solution in the PR is ported to this repo and merged. |
|
I'm trying to convert a struct to a map, and can't figure out how to make it work.
Basically I have these structs:
and I want to convert
SQLStepResult
to:But I always end up with
Rows
instead ofrows
.I tried using the undocumented
mapstructure.RecursiveStructToMapHookFunc
but it doesn't appear to do anythingIs there a solution?
Go playground for reference: https://go.dev/play/p/ZlTOw1mqnH5
The text was updated successfully, but these errors were encountered: