Closed iyear closed 2 years ago
Thanks for such a good library! In https://github.com/mitchellh/mapstructure/blob/main/mapstructure.go#L459-L461 I found that all three DecodeHooks can't get the corresponding name.
DecodeHook
In some scenarios, I need to get the corresponding name as a unique key, can I add three new DecodeHooks that carry the name parameter?
For example:
type DecodeHookFuncTypeWithName func(name string, reflect.Type, reflect.Type, interface{}) (interface{}, error) type DecodeHookFuncKindWithName func(name string, reflect.Kind, reflect.Kind, interface{}) (interface{}, error) type DecodeHookFuncValueWithName func(name string, from reflect.Value, to reflect.Value) (interface{}, error)
Thanks for such a good library! In https://github.com/mitchellh/mapstructure/blob/main/mapstructure.go#L459-L461 I found that all three
DecodeHook
s can't get the corresponding name.In some scenarios, I need to get the corresponding name as a unique key, can I add three new DecodeHooks that carry the name parameter?
For example: