Fix DecodeHook support for decoding map from struct#171
Fix DecodeHook support for decoding map from struct#171pamburus wants to merge 3 commits intomitchellh:mainfrom
Conversation
|
This issue is also causing me trouble. Effectively, it makes it so even though I can make |
|
I would also greatly appreciate seeing this issue resolved. We are currently having to use a fork of mapstructure in our product. |
|
Hello! Apologies it has been awhile. I tried to fix the conflicts and merge this but the tests don't pass. If you can rebase and fix that, I'll merge just ping me. |
173c4de to
f58aecc
Compare
|
Ok, I've rebased the pull request and added temporary hack to make tests working. TestDecode_StructTaggedWithOmitempty_OmitEmptyValues and TestDecode_StructTaggedWithOmitempty_KeepNonEmptyValues expect that typed nil pointer (VisibleNested) is decoded to a But if input != nil {
inputVal = reflect.ValueOf(input)
// We need to check here if input is a typed nil. Typed nils won't
// match the "input == nil" below so we check that here.
if inputVal.Kind() == reflect.Ptr && inputVal.IsNil() {
input = nil
}
}Why do we have 2 opposite decisions for decoding a simple value vs decoding a struct field? So, let's decide whether we just fix the expectation of the tests to expect untyped |
No description provided.