From 34a2174be3bb942be59c88c22d4b77c1e8af8b30 Mon Sep 17 00:00:00 2001 From: Tao Wen Date: Mon, 31 Jul 2017 21:48:22 +0800 Subject: [PATCH] #142 decode struct field should be case insensitiveyet another fix --- feature_reflect_struct_decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature_reflect_struct_decoder.go b/feature_reflect_struct_decoder.go index a555279..3c3560c 100644 --- a/feature_reflect_struct_decoder.go +++ b/feature_reflect_struct_decoder.go @@ -429,7 +429,7 @@ func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) } fieldBytes := iter.readObjectFieldAsBytes() field := *(*string)(unsafe.Pointer(&fieldBytes)) - fieldDecoder := decoder.fields[field] + fieldDecoder := decoder.fields[strings.ToLower(field)] if fieldDecoder == nil { iter.Skip() } else {