1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-30 23:23:49 +02:00
This commit is contained in:
Tao Wen
2018-02-24 22:04:41 +08:00
parent 8d6662b81b
commit fff342fd04
72 changed files with 165 additions and 176 deletions

@ -2,12 +2,12 @@ package jsoniter
import (
"fmt"
"github.com/v2pro/plz/reflect2"
"reflect"
"sort"
"strings"
"unicode"
"unsafe"
"github.com/v2pro/plz/reflect2"
)
var typeDecoders = map[string]ValDecoder{}
@ -18,8 +18,8 @@ var extensions = []Extension{}
// StructDescriptor describe how should we encode/decode the struct
type StructDescriptor struct {
Type reflect2.Type
Fields []*Binding
Type reflect2.Type
Fields []*Binding
}
// GetField get one field from the descriptor by its name.
@ -387,8 +387,8 @@ func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor {
}
func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor {
structDescriptor := &StructDescriptor{
Type: typ,
Fields: bindings,
Type: typ,
Fields: bindings,
}
for _, extension := range extensions {
extension.UpdateStructDescriptor(structDescriptor)