commit 82cfd3ba95390dcba2eb5564c225daf9a168d008
parent 7580ec0613f0a3107056360a386da9d652e5da24
Author: francoispqt <francois@parquet.ninja>
Date: Wed, 27 Mar 2019 22:28:28 +0800
remove call to decodeTypedField in encoding
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gojay/codegen/struct.go b/gojay/codegen/struct.go
@@ -276,13 +276,12 @@ func (s *Struct) generateFieldEncoding(fields []*toolbox.FieldInfo) ([]string, e
templateKey = encodeStructSlice
break main
} else if field.IsSlice {
- s.typedFieldDecode(field, field.ComponentType)
templateKey = encodeStructSlice
} else if _, k, ok := s.typedFieldEncode(field, field.Type); ok {
templateKey = k
} else {
// templateKey = decodeUnknown
- return "", nil, fmt.Errorf("Unknown type %s for field %s", field.Type, field.Name)
+ return nil, fmt.Errorf("Unknown type %s for field %s", field.Type, field.Name)
}
}
if templateKey != -1 {