1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-27 23:18:42 +02:00

split config into Config and frozenConfig

This commit is contained in:
Tao Wen
2017-06-13 18:49:35 +08:00
parent d0418857ce
commit d867c8ba5c
11 changed files with 61 additions and 65 deletions

@ -9,7 +9,7 @@ import (
"unsafe"
)
func encoderOfStruct(cfg *Config, typ reflect.Type) (Encoder, error) {
func encoderOfStruct(cfg *frozenConfig, typ reflect.Type) (Encoder, error) {
structEncoder_ := &structEncoder{}
fields := map[string]*structFieldEncoder{}
for _, field := range listStructFields(typ) {
@ -80,7 +80,7 @@ func listStructFields(typ reflect.Type) []*reflect.StructField {
return fields
}
func decoderOfStruct(cfg *Config, typ reflect.Type) (Decoder, error) {
func decoderOfStruct(cfg *frozenConfig, typ reflect.Type) (Decoder, error) {
fields := map[string]*structFieldDecoder{}
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)