Kaynağa Gözat

codec: do not generate fast-path for uncommon types, and generate sort.Sort wrappers

We no longer generate fast-paths for maps with
- keys of type int8/16/32, uint16/32, float32/64, bool, interface{}
- values of type int8/16/32, uint16/32

This is in a bid to reduce the binary size for types which depend on go-codec.

Previously, go-codec was adding about 11MB to a binary.
We have now reduce that to 5.7MB.

The user has the option to reduce this further to
2.9MB by passing the tag 'notfastpath' during a build or install.

In addition, we now generate sort.Sort wrappers for types we care about.
This way, we don't have to maintain the code manually.

In generated fast-path and other code, we also reduced the amount of unnecessary
conversions we do.

Updates #295
Updates cisco/senml#22
Fixes #296
Ugorji Nwoke 6 yıl önce
ebeveyn
işleme
a2154fa654

+ 2 - 0
codec/bench/.gitignore

@@ -0,0 +1,2 @@
+*_generated_*.*
+

+ 6 - 5
codec/build.sh

@@ -116,17 +116,18 @@ run("fast-path.go.tmpl", "fast-path.generated.go")
 run("gen-helper.go.tmpl", "gen-helper.generated.go")
 run("mammoth-test.go.tmpl", "mammoth_generated_test.go")
 run("mammoth2-test.go.tmpl", "mammoth2_generated_test.go")
+// run("sort-slice.go.tmpl", "sort-slice.generated.go")
 }
 EOF
 
     sed -e 's+// __DO_NOT_REMOVE__NEEDED_FOR_REPLACING__IMPORT_PATH__FOR_CODEC_BENCH__+import . "github.com/ugorji/go/codec"+' \
         shared_test.go > bench/shared_test.go
-    
+
     # explicitly return 0 if this passes, else return 1
-    go run -tags "notfastpath safe codecgen.exec" gen-from-tmpl.generated.go &&
-        rm -f gen-from-tmpl.*generated.go &&
-        return 0
-    return 1
+    go run -tags "prebuild" prebuild.go || return 1
+    go run -tags "notfastpath safe codecgen.exec" gen-from-tmpl.generated.go || return 1
+    rm -f gen-from-tmpl.*generated.go
+    return 0
 }
 
 _codegenerators() {

+ 8 - 8
codec/encode.go

@@ -944,13 +944,13 @@ func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []refl
 			e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true)
 		}
 	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr:
-		mksv := make([]uintRv, len(mks))
+		mksv := make([]uint64Rv, len(mks))
 		for i, k := range mks {
 			v := &mksv[i]
 			v.r = k
 			v.v = k.Uint()
 		}
-		sort.Sort(uintRvSlice(mksv))
+		sort.Sort(uint64RvSlice(mksv))
 		for i := range mksv {
 			if elemsep {
 				ee.WriteMapElemKey()
@@ -962,13 +962,13 @@ func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []refl
 			e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true)
 		}
 	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
-		mksv := make([]intRv, len(mks))
+		mksv := make([]int64Rv, len(mks))
 		for i, k := range mks {
 			v := &mksv[i]
 			v.r = k
 			v.v = k.Int()
 		}
-		sort.Sort(intRvSlice(mksv))
+		sort.Sort(int64RvSlice(mksv))
 		for i := range mksv {
 			if elemsep {
 				ee.WriteMapElemKey()
@@ -980,13 +980,13 @@ func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []refl
 			e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true)
 		}
 	case reflect.Float32:
-		mksv := make([]floatRv, len(mks))
+		mksv := make([]float64Rv, len(mks))
 		for i, k := range mks {
 			v := &mksv[i]
 			v.r = k
 			v.v = k.Float()
 		}
-		sort.Sort(floatRvSlice(mksv))
+		sort.Sort(float64RvSlice(mksv))
 		for i := range mksv {
 			if elemsep {
 				ee.WriteMapElemKey()
@@ -998,13 +998,13 @@ func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []refl
 			e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true)
 		}
 	case reflect.Float64:
-		mksv := make([]floatRv, len(mks))
+		mksv := make([]float64Rv, len(mks))
 		for i, k := range mks {
 			v := &mksv[i]
 			v.r = k
 			v.v = k.Float()
 		}
-		sort.Sort(floatRvSlice(mksv))
+		sort.Sort(float64RvSlice(mksv))
 		for i := range mksv {
 			if elemsep {
 				ee.WriteMapElemKey()

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 812
codec/fast-path.generated.go


+ 8 - 8
codec/fast-path.go.tmpl

@@ -226,13 +226,13 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Ele
 	if v == nil { e.e.EncodeNil(); return }
 	ee, esep := e.e, e.hh.hasElemSeparators() 
 	ee.WriteMapStart(len(v))
-	if e.h.Canonical {
+	if e.h.Canonical { {{/* need to figure out .NoCanonical */}}
 		{{if eq .MapKey "interface{}"}}{{/* out of band 
 		*/}}var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding
 		e2 := NewEncoderBytes(&mksv, e.hh)
-		v2 := make([]bytesI, len(v))
+		v2 := make([]bytesIntf, len(v))
 		var i, l uint
-		var vp *bytesI {{/* put loop variables outside. seems currently needed for better perf */}}
+		var vp *bytesIntf {{/* put loop variables outside. seems currently needed for better perf */}}
 		for k2 := range v {
 			l = uint(len(mksv))
 			e2.MustEncode(k2)
@@ -241,7 +241,7 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Ele
 			vp.i = k2 
 			i++
 		}
-		sort.Sort(bytesISlice(v2))
+		sort.Sort(bytesIntfSlice(v2))
 		for j := range v2 {
 			if esep { ee.WriteMapElemKey() }
 			e.asis(v2[j].v)
@@ -250,17 +250,17 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Ele
 		} {{else}}{{ $x := sorttype .MapKey true}}v2 := make([]{{ $x }}, len(v))
 		var i uint
 		for k := range v {
-			v2[i] = {{ $x }}(k)
+			v2[i] = {{if eq $x .MapKey}}k{{else}}{{ $x }}(k){{end}}
 			i++
 		}
 		sort.Sort({{ sorttype .MapKey false}}(v2))
 		for _, k2 := range v2 {
 			if esep { ee.WriteMapElemKey() }
-			{{if eq .MapKey "string"}} if e.h.StringToRaw {ee.EncodeStringBytesRaw(bytesView(k2))} else {ee.EncodeStringEnc(cUTF8, k2)} {{else}}{{ $y := printf "%s(k2)" .MapKey }}{{ encmd .MapKey $y }}{{end}}
+			{{if eq .MapKey "string"}} if e.h.StringToRaw {ee.EncodeStringBytesRaw(bytesView(k2))} else {ee.EncodeStringEnc(cUTF8, k2)} {{else}}{{ $y := printf "%s(k2)" .MapKey }}{{if eq $x .MapKey }}{{ $y = "k2" }}{{end}}{{ encmd .MapKey $y }}{{end}}
 			if esep { ee.WriteMapElemValue() }
-			{{ $y := printf "v[%s(k2)]" .MapKey }}{{ encmd .Elem $y }}
+			{{ $y := printf "v[%s(k2)]" .MapKey }}{{if eq $x .MapKey }}{{ $y = "v[k2]" }}{{end}}{{ encmd .Elem $y }}
 		} {{end}}
-	} else {
+	} else { 
 		for k2, v2 := range v {
 			if esep { ee.WriteMapElemKey() }
 			{{if eq .MapKey "string"}} if e.h.StringToRaw {ee.EncodeStringBytesRaw(bytesView(k2))} else {ee.EncodeStringEnc(cUTF8, k2)} {{else}}{{ encmd .MapKey "k2"}}{{end}}

+ 134 - 68
codec/gen.go

@@ -123,6 +123,15 @@ const (
 	//
 	// From testing, it didn't make much difference in runtime, so keep as true (one function only)
 	genUseOneFunctionForDecStructMap = true
+
+	// genFastpathCanonical configures whether we support Canonical in fast path.
+	// The savings is not much.
+	//
+	// NOTE: This MUST ALWAYS BE TRUE. fast-path.go.tmp doesn't handle it being false.
+	genFastpathCanonical = true // MUST be true
+
+	// genFastpathTrimTypes configures whether we trim uncommon fastpath types.
+	genFastpathTrimTypes = true
 )
 
 type genStructMapStyle uint8
@@ -814,7 +823,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
 		if rtid == uint8SliceTypId {
 			x.line("r.EncodeStringBytesRaw([]byte(" + varname + "))")
 		} else if fastpathAV.index(rtid) != -1 {
-			g := x.newGenV(t)
+			g := x.newFastpathGenV(t)
 			x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)")
 		} else {
 			x.xtraSM(varname, t, true, false)
@@ -828,7 +837,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) {
 		// - else call Encoder.encode(XXX) on it.
 		// x.line("if " + varname + " == nil { \nr.EncodeNil()\n } else { ")
 		if fastpathAV.index(rtid) != -1 {
-			g := x.newGenV(t)
+			g := x.newFastpathGenV(t)
 			x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)")
 		} else {
 			x.xtraSM(varname, t, true, false)
@@ -1382,7 +1391,7 @@ func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) {
 			x.linef("%s%s = r.DecodeBytes(%s(%s[]byte)(%s), false)",
 				ptrPfx, varname, ptrPfx, ptrPfx, varname)
 		} else if fastpathAV.index(rtid) != -1 {
-			g := x.newGenV(t)
+			g := x.newFastpathGenV(t)
 			x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname)
 		} else {
 			x.xtraSM(varname, t, false, isptr)
@@ -1394,7 +1403,7 @@ func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) {
 		// - if elements are primitives or Selfers, call dedicated function on each member.
 		// - else call Encoder.encode(XXX) on it.
 		if fastpathAV.index(rtid) != -1 {
-			g := x.newGenV(t)
+			g := x.newFastpathGenV(t)
 			x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname)
 		} else {
 			x.xtraSM(varname, t, false, isptr)
@@ -1701,15 +1710,17 @@ func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) {
 
 // --------
 
-type genV struct {
-	// genV is either a primitive (Primitive != "") or a map (MapKey != "") or a slice
-	MapKey    string
-	Elem      string
-	Primitive string
-	Size      int
+type fastpathGenV struct {
+	// fastpathGenV is either a primitive (Primitive != "") or a map (MapKey != "") or a slice
+	MapKey      string
+	Elem        string
+	Primitive   string
+	Size        int
+	NoCanonical bool
 }
 
-func (x *genRunner) newGenV(t reflect.Type) (v genV) {
+func (x *genRunner) newFastpathGenV(t reflect.Type) (v fastpathGenV) {
+	v.NoCanonical = !genFastpathCanonical
 	switch t.Kind() {
 	case reflect.Slice, reflect.Array:
 		te := t.Elem()
@@ -1721,12 +1732,12 @@ func (x *genRunner) newGenV(t reflect.Type) (v genV) {
 		v.MapKey = x.genTypeName(tk)
 		v.Size = int(te.Size() + tk.Size())
 	default:
-		panic("unexpected type for newGenV. Requires map or slice type")
+		panic("unexpected type for newFastpathGenV. Requires map or slice type")
 	}
 	return
 }
 
-func (x *genV) MethodNamePfx(prefix string, prim bool) string {
+func (x *fastpathGenV) MethodNamePfx(prefix string, prim bool) string {
 	var name []byte
 	if prefix != "" {
 		name = append(name, prefix...)
@@ -1878,7 +1889,7 @@ func genIsImmutable(t reflect.Type) (v bool) {
 
 type genInternal struct {
 	Version int
-	Values  []genV
+	Values  []fastpathGenV
 }
 
 func (x genInternal) FastpathLen() (l int) {
@@ -1931,9 +1942,13 @@ func genInternalNonZeroValue(s string) string {
 
 func genInternalEncCommandAsString(s string, vname string) string {
 	switch s {
-	case "uint", "uint8", "uint16", "uint32", "uint64":
+	case "uint64":
+		return "ee.EncodeUint(" + vname + ")"
+	case "uint", "uint8", "uint16", "uint32":
 		return "ee.EncodeUint(uint64(" + vname + "))"
-	case "int", "int8", "int16", "int32", "int64":
+	case "int64":
+		return "ee.EncodeInt(" + vname + ")"
+	case "int", "int8", "int16", "int32":
 		return "ee.EncodeInt(int64(" + vname + "))"
 	case "string":
 		return "if e.h.StringToRaw { ee.EncodeStringBytesRaw(bytesView(" + vname + ")) " +
@@ -1992,12 +2007,11 @@ func genInternalDecCommandAsString(s string) string {
 func genInternalSortType(s string, elem bool) string {
 	for _, v := range [...]string{"int", "uint", "float", "bool", "string"} {
 		if strings.HasPrefix(s, v) {
+			if v == "int" || v == "uint" || v == "float" {
+				v += "64"
+			}
 			if elem {
-				if v == "int" || v == "uint" || v == "float" {
-					return v + "64"
-				} else {
-					return v
-				}
+				return v
 			}
 			return v + "Slice"
 		}
@@ -2024,47 +2038,9 @@ var genInternalTmplFuncs template.FuncMap
 var genInternalOnce sync.Once
 
 func genInternalInit() {
-	types := [...]string{
-		"interface{}",
-		"string",
-		"float32",
-		"float64",
-		"uint",
-		"uint8",
-		"uint16",
-		"uint32",
-		"uint64",
-		"uintptr",
-		"int",
-		"int8",
-		"int16",
-		"int32",
-		"int64",
-		"bool",
-	}
-	// keep as slice, so it is in specific iteration order.
-	// Initial order was uint64, string, interface{}, int, int64
-	mapvaltypes := [...]string{
-		"interface{}",
-		"string",
-		"uint",
-		"uint8",
-		"uint16",
-		"uint32",
-		"uint64",
-		"uintptr",
-		"int",
-		"int8",
-		"int16",
-		"int32",
-		"int64",
-		"float32",
-		"float64",
-		"bool",
-	}
 	wordSizeBytes := int(intBitsize) / 8
 
-	mapvaltypes2 := map[string]int{
+	typesizes := map[string]int{
 		"interface{}": 2 * wordSizeBytes,
 		"string":      2 * wordSizeBytes,
 		"uint":        1 * wordSizeBytes,
@@ -2082,20 +2058,110 @@ func genInternalInit() {
 		"float64":     8,
 		"bool":        1,
 	}
+
+	// keep as slice, so it is in specific iteration order.
+	// Initial order was uint64, string, interface{}, int, int64, ...
+
+	var types = [...]string{
+		"interface{}",
+		"string",
+		"float32",
+		"float64",
+		"uint",
+		"uint8",
+		"uint16",
+		"uint32",
+		"uint64",
+		"uintptr",
+		"int",
+		"int8",
+		"int16",
+		"int32",
+		"int64",
+		"bool",
+	}
+
+	var primitivetypes, slicetypes, mapkeytypes, mapvaltypes []string
+
+	primitivetypes = types[:]
+	slicetypes = types[:]
+	mapkeytypes = types[:]
+	mapvaltypes = types[:]
+
+	if genFastpathTrimTypes {
+		mapkeytypes = []string{
+			//"interface{}",
+			"string",
+			//"float32",
+			//"float64",
+			"uint",
+			"uint8",
+			//"uint16",
+			//"uint32",
+			"uint64",
+			"uintptr",
+			"int",
+			//"int8",
+			//"int16",
+			//"int32",
+			"int64",
+			// "bool",
+		}
+
+		mapvaltypes = []string{
+			"interface{}",
+			"string",
+			"uint",
+			"uint8",
+			//"uint16",
+			//"uint32",
+			"uint64",
+			"uintptr",
+			"int",
+			//"int8",
+			//"int16",
+			//"int32",
+			"int64",
+			"float32",
+			"float64",
+			"bool",
+		}
+	}
+
+	// var mapkeytypes [len(&types) - 1]string // skip bool
+	// copy(mapkeytypes[:], types[:])
+
+	// var mb []byte
+	// mb = append(mb, '|')
+	// for _, s := range mapkeytypes {
+	// 	mb = append(mb, s...)
+	// 	mb = append(mb, '|')
+	// }
+	// var mapkeytypestr = string(mb)
+
 	var gt = genInternal{Version: genVersion}
 
 	// For each slice or map type, there must be a (symmetrical) Encode and Decode fast-path function
-	for _, s := range types {
-		gt.Values = append(gt.Values, genV{Primitive: s, Size: mapvaltypes2[s]})
+
+	for _, s := range primitivetypes {
+		gt.Values = append(gt.Values,
+			fastpathGenV{Primitive: s, Size: typesizes[s], NoCanonical: !genFastpathCanonical})
+	}
+	for _, s := range slicetypes {
 		// if s != "uint8" { // do not generate fast path for slice of bytes. Treat specially already.
-		// 	gt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]})
+		// 	gt.Values = append(gt.Values, fastpathGenV{Elem: s, Size: typesizes[s]})
+		// }
+		gt.Values = append(gt.Values,
+			fastpathGenV{Elem: s, Size: typesizes[s], NoCanonical: !genFastpathCanonical})
+	}
+	for _, s := range mapkeytypes {
+		// if _, ok := typesizes[s]; !ok {
+		// if strings.Contains(mapkeytypestr, "|"+s+"|") {
+		// 	gt.Values = append(gt.Values, fastpathGenV{MapKey: s, Elem: s, Size: 2 * typesizes[s]})
 		// }
-		gt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]})
-		if _, ok := mapvaltypes2[s]; !ok {
-			gt.Values = append(gt.Values, genV{MapKey: s, Elem: s, Size: 2 * mapvaltypes2[s]})
-		}
 		for _, ms := range mapvaltypes {
-			gt.Values = append(gt.Values, genV{MapKey: s, Elem: ms, Size: mapvaltypes2[s] + mapvaltypes2[ms]})
+			gt.Values = append(gt.Values,
+				fastpathGenV{MapKey: s, Elem: ms, Size: typesizes[s] + typesizes[ms], NoCanonical: !genFastpathCanonical})
 		}
 	}
 

+ 3 - 122
codec/helper.go

@@ -2129,7 +2129,9 @@ func (x checkOverflow) SignedIntV(v uint64) int64 {
 
 // ------------------ SORT -----------------
 
-func isNaN(f float64) bool { return f != f }
+// func isNaN(f float64) bool   { return f != f }
+func isNaN64(f float64) bool { return f != f }
+func isNaN32(f float32) bool { return f != f }
 
 // -----------------------
 
@@ -2147,132 +2149,11 @@ type ioBuffered interface {
 
 // -----------------------
 
-type intSlice []int64
-type uintSlice []uint64
-
-// type uintptrSlice []uintptr
-type floatSlice []float64
-type boolSlice []bool
-type stringSlice []string
-
-// type bytesSlice [][]byte
-
-func (p intSlice) Len() int           { return len(p) }
-func (p intSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }
-func (p intSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p uintSlice) Len() int           { return len(p) }
-func (p uintSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }
-func (p uintSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-// func (p uintptrSlice) Len() int           { return len(p) }
-// func (p uintptrSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }
-// func (p uintptrSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p floatSlice) Len() int { return len(p) }
-func (p floatSlice) Less(i, j int) bool {
-	return p[uint(i)] < p[uint(j)] || isNaN(p[uint(i)]) && !isNaN(p[uint(j)])
-}
-func (p floatSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p stringSlice) Len() int           { return len(p) }
-func (p stringSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }
-func (p stringSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-// func (p bytesSlice) Len() int           { return len(p) }
-// func (p bytesSlice) Less(i, j int) bool { return bytes.Compare(p[uint(i)], p[uint(j)]) == -1 }
-// func (p bytesSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p boolSlice) Len() int           { return len(p) }
-func (p boolSlice) Less(i, j int) bool { return !p[uint(i)] && p[uint(j)] }
-func (p boolSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-// ---------------------
-
 type sfiRv struct {
 	v *structFieldInfo
 	r reflect.Value
 }
 
-type intRv struct {
-	v int64
-	r reflect.Value
-}
-type intRvSlice []intRv
-type uintRv struct {
-	v uint64
-	r reflect.Value
-}
-type uintRvSlice []uintRv
-type floatRv struct {
-	v float64
-	r reflect.Value
-}
-type floatRvSlice []floatRv
-type boolRv struct {
-	v bool
-	r reflect.Value
-}
-type boolRvSlice []boolRv
-type stringRv struct {
-	v string
-	r reflect.Value
-}
-type stringRvSlice []stringRv
-type bytesRv struct {
-	v []byte
-	r reflect.Value
-}
-type bytesRvSlice []bytesRv
-type timeRv struct {
-	v time.Time
-	r reflect.Value
-}
-type timeRvSlice []timeRv
-
-func (p intRvSlice) Len() int           { return len(p) }
-func (p intRvSlice) Less(i, j int) bool { return p[uint(i)].v < p[uint(j)].v }
-func (p intRvSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p uintRvSlice) Len() int           { return len(p) }
-func (p uintRvSlice) Less(i, j int) bool { return p[uint(i)].v < p[uint(j)].v }
-func (p uintRvSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p floatRvSlice) Len() int { return len(p) }
-func (p floatRvSlice) Less(i, j int) bool {
-	return p[uint(i)].v < p[uint(j)].v || isNaN(p[uint(i)].v) && !isNaN(p[uint(j)].v)
-}
-func (p floatRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p stringRvSlice) Len() int           { return len(p) }
-func (p stringRvSlice) Less(i, j int) bool { return p[uint(i)].v < p[uint(j)].v }
-func (p stringRvSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p bytesRvSlice) Len() int           { return len(p) }
-func (p bytesRvSlice) Less(i, j int) bool { return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1 }
-func (p bytesRvSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p boolRvSlice) Len() int           { return len(p) }
-func (p boolRvSlice) Less(i, j int) bool { return !p[uint(i)].v && p[uint(j)].v }
-func (p boolRvSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-func (p timeRvSlice) Len() int           { return len(p) }
-func (p timeRvSlice) Less(i, j int) bool { return p[uint(i)].v.Before(p[uint(j)].v) }
-func (p timeRvSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
-// -----------------
-
-type bytesI struct {
-	v []byte
-	i interface{}
-}
-
-type bytesISlice []bytesI
-
-func (p bytesISlice) Len() int           { return len(p) }
-func (p bytesISlice) Less(i, j int) bool { return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1 }
-func (p bytesISlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
-
 // -----------------
 
 type set []uintptr

Dosya farkı çok büyük olduğundan ihmal edildi
+ 189 - 189
codec/mammoth2_codecgen_generated_test.go


+ 0 - 358
codec/mammoth2_generated_test.go

@@ -94,38 +94,6 @@ type TestMammoth2 struct {
 	FSliceBool       []bool
 	FptrSliceBool    *[]bool
 
-	FMapIntfIntf          map[interface{}]interface{}
-	FptrMapIntfIntf       *map[interface{}]interface{}
-	FMapIntfString        map[interface{}]string
-	FptrMapIntfString     *map[interface{}]string
-	FMapIntfUint          map[interface{}]uint
-	FptrMapIntfUint       *map[interface{}]uint
-	FMapIntfUint8         map[interface{}]uint8
-	FptrMapIntfUint8      *map[interface{}]uint8
-	FMapIntfUint16        map[interface{}]uint16
-	FptrMapIntfUint16     *map[interface{}]uint16
-	FMapIntfUint32        map[interface{}]uint32
-	FptrMapIntfUint32     *map[interface{}]uint32
-	FMapIntfUint64        map[interface{}]uint64
-	FptrMapIntfUint64     *map[interface{}]uint64
-	FMapIntfUintptr       map[interface{}]uintptr
-	FptrMapIntfUintptr    *map[interface{}]uintptr
-	FMapIntfInt           map[interface{}]int
-	FptrMapIntfInt        *map[interface{}]int
-	FMapIntfInt8          map[interface{}]int8
-	FptrMapIntfInt8       *map[interface{}]int8
-	FMapIntfInt16         map[interface{}]int16
-	FptrMapIntfInt16      *map[interface{}]int16
-	FMapIntfInt32         map[interface{}]int32
-	FptrMapIntfInt32      *map[interface{}]int32
-	FMapIntfInt64         map[interface{}]int64
-	FptrMapIntfInt64      *map[interface{}]int64
-	FMapIntfFloat32       map[interface{}]float32
-	FptrMapIntfFloat32    *map[interface{}]float32
-	FMapIntfFloat64       map[interface{}]float64
-	FptrMapIntfFloat64    *map[interface{}]float64
-	FMapIntfBool          map[interface{}]bool
-	FptrMapIntfBool       *map[interface{}]bool
 	FMapStringIntf        map[string]interface{}
 	FptrMapStringIntf     *map[string]interface{}
 	FMapStringString      map[string]string
@@ -134,22 +102,12 @@ type TestMammoth2 struct {
 	FptrMapStringUint     *map[string]uint
 	FMapStringUint8       map[string]uint8
 	FptrMapStringUint8    *map[string]uint8
-	FMapStringUint16      map[string]uint16
-	FptrMapStringUint16   *map[string]uint16
-	FMapStringUint32      map[string]uint32
-	FptrMapStringUint32   *map[string]uint32
 	FMapStringUint64      map[string]uint64
 	FptrMapStringUint64   *map[string]uint64
 	FMapStringUintptr     map[string]uintptr
 	FptrMapStringUintptr  *map[string]uintptr
 	FMapStringInt         map[string]int
 	FptrMapStringInt      *map[string]int
-	FMapStringInt8        map[string]int8
-	FptrMapStringInt8     *map[string]int8
-	FMapStringInt16       map[string]int16
-	FptrMapStringInt16    *map[string]int16
-	FMapStringInt32       map[string]int32
-	FptrMapStringInt32    *map[string]int32
 	FMapStringInt64       map[string]int64
 	FptrMapStringInt64    *map[string]int64
 	FMapStringFloat32     map[string]float32
@@ -158,70 +116,6 @@ type TestMammoth2 struct {
 	FptrMapStringFloat64  *map[string]float64
 	FMapStringBool        map[string]bool
 	FptrMapStringBool     *map[string]bool
-	FMapFloat32Intf       map[float32]interface{}
-	FptrMapFloat32Intf    *map[float32]interface{}
-	FMapFloat32String     map[float32]string
-	FptrMapFloat32String  *map[float32]string
-	FMapFloat32Uint       map[float32]uint
-	FptrMapFloat32Uint    *map[float32]uint
-	FMapFloat32Uint8      map[float32]uint8
-	FptrMapFloat32Uint8   *map[float32]uint8
-	FMapFloat32Uint16     map[float32]uint16
-	FptrMapFloat32Uint16  *map[float32]uint16
-	FMapFloat32Uint32     map[float32]uint32
-	FptrMapFloat32Uint32  *map[float32]uint32
-	FMapFloat32Uint64     map[float32]uint64
-	FptrMapFloat32Uint64  *map[float32]uint64
-	FMapFloat32Uintptr    map[float32]uintptr
-	FptrMapFloat32Uintptr *map[float32]uintptr
-	FMapFloat32Int        map[float32]int
-	FptrMapFloat32Int     *map[float32]int
-	FMapFloat32Int8       map[float32]int8
-	FptrMapFloat32Int8    *map[float32]int8
-	FMapFloat32Int16      map[float32]int16
-	FptrMapFloat32Int16   *map[float32]int16
-	FMapFloat32Int32      map[float32]int32
-	FptrMapFloat32Int32   *map[float32]int32
-	FMapFloat32Int64      map[float32]int64
-	FptrMapFloat32Int64   *map[float32]int64
-	FMapFloat32Float32    map[float32]float32
-	FptrMapFloat32Float32 *map[float32]float32
-	FMapFloat32Float64    map[float32]float64
-	FptrMapFloat32Float64 *map[float32]float64
-	FMapFloat32Bool       map[float32]bool
-	FptrMapFloat32Bool    *map[float32]bool
-	FMapFloat64Intf       map[float64]interface{}
-	FptrMapFloat64Intf    *map[float64]interface{}
-	FMapFloat64String     map[float64]string
-	FptrMapFloat64String  *map[float64]string
-	FMapFloat64Uint       map[float64]uint
-	FptrMapFloat64Uint    *map[float64]uint
-	FMapFloat64Uint8      map[float64]uint8
-	FptrMapFloat64Uint8   *map[float64]uint8
-	FMapFloat64Uint16     map[float64]uint16
-	FptrMapFloat64Uint16  *map[float64]uint16
-	FMapFloat64Uint32     map[float64]uint32
-	FptrMapFloat64Uint32  *map[float64]uint32
-	FMapFloat64Uint64     map[float64]uint64
-	FptrMapFloat64Uint64  *map[float64]uint64
-	FMapFloat64Uintptr    map[float64]uintptr
-	FptrMapFloat64Uintptr *map[float64]uintptr
-	FMapFloat64Int        map[float64]int
-	FptrMapFloat64Int     *map[float64]int
-	FMapFloat64Int8       map[float64]int8
-	FptrMapFloat64Int8    *map[float64]int8
-	FMapFloat64Int16      map[float64]int16
-	FptrMapFloat64Int16   *map[float64]int16
-	FMapFloat64Int32      map[float64]int32
-	FptrMapFloat64Int32   *map[float64]int32
-	FMapFloat64Int64      map[float64]int64
-	FptrMapFloat64Int64   *map[float64]int64
-	FMapFloat64Float32    map[float64]float32
-	FptrMapFloat64Float32 *map[float64]float32
-	FMapFloat64Float64    map[float64]float64
-	FptrMapFloat64Float64 *map[float64]float64
-	FMapFloat64Bool       map[float64]bool
-	FptrMapFloat64Bool    *map[float64]bool
 	FMapUintIntf          map[uint]interface{}
 	FptrMapUintIntf       *map[uint]interface{}
 	FMapUintString        map[uint]string
@@ -230,22 +124,12 @@ type TestMammoth2 struct {
 	FptrMapUintUint       *map[uint]uint
 	FMapUintUint8         map[uint]uint8
 	FptrMapUintUint8      *map[uint]uint8
-	FMapUintUint16        map[uint]uint16
-	FptrMapUintUint16     *map[uint]uint16
-	FMapUintUint32        map[uint]uint32
-	FptrMapUintUint32     *map[uint]uint32
 	FMapUintUint64        map[uint]uint64
 	FptrMapUintUint64     *map[uint]uint64
 	FMapUintUintptr       map[uint]uintptr
 	FptrMapUintUintptr    *map[uint]uintptr
 	FMapUintInt           map[uint]int
 	FptrMapUintInt        *map[uint]int
-	FMapUintInt8          map[uint]int8
-	FptrMapUintInt8       *map[uint]int8
-	FMapUintInt16         map[uint]int16
-	FptrMapUintInt16      *map[uint]int16
-	FMapUintInt32         map[uint]int32
-	FptrMapUintInt32      *map[uint]int32
 	FMapUintInt64         map[uint]int64
 	FptrMapUintInt64      *map[uint]int64
 	FMapUintFloat32       map[uint]float32
@@ -262,22 +146,12 @@ type TestMammoth2 struct {
 	FptrMapUint8Uint      *map[uint8]uint
 	FMapUint8Uint8        map[uint8]uint8
 	FptrMapUint8Uint8     *map[uint8]uint8
-	FMapUint8Uint16       map[uint8]uint16
-	FptrMapUint8Uint16    *map[uint8]uint16
-	FMapUint8Uint32       map[uint8]uint32
-	FptrMapUint8Uint32    *map[uint8]uint32
 	FMapUint8Uint64       map[uint8]uint64
 	FptrMapUint8Uint64    *map[uint8]uint64
 	FMapUint8Uintptr      map[uint8]uintptr
 	FptrMapUint8Uintptr   *map[uint8]uintptr
 	FMapUint8Int          map[uint8]int
 	FptrMapUint8Int       *map[uint8]int
-	FMapUint8Int8         map[uint8]int8
-	FptrMapUint8Int8      *map[uint8]int8
-	FMapUint8Int16        map[uint8]int16
-	FptrMapUint8Int16     *map[uint8]int16
-	FMapUint8Int32        map[uint8]int32
-	FptrMapUint8Int32     *map[uint8]int32
 	FMapUint8Int64        map[uint8]int64
 	FptrMapUint8Int64     *map[uint8]int64
 	FMapUint8Float32      map[uint8]float32
@@ -286,70 +160,6 @@ type TestMammoth2 struct {
 	FptrMapUint8Float64   *map[uint8]float64
 	FMapUint8Bool         map[uint8]bool
 	FptrMapUint8Bool      *map[uint8]bool
-	FMapUint16Intf        map[uint16]interface{}
-	FptrMapUint16Intf     *map[uint16]interface{}
-	FMapUint16String      map[uint16]string
-	FptrMapUint16String   *map[uint16]string
-	FMapUint16Uint        map[uint16]uint
-	FptrMapUint16Uint     *map[uint16]uint
-	FMapUint16Uint8       map[uint16]uint8
-	FptrMapUint16Uint8    *map[uint16]uint8
-	FMapUint16Uint16      map[uint16]uint16
-	FptrMapUint16Uint16   *map[uint16]uint16
-	FMapUint16Uint32      map[uint16]uint32
-	FptrMapUint16Uint32   *map[uint16]uint32
-	FMapUint16Uint64      map[uint16]uint64
-	FptrMapUint16Uint64   *map[uint16]uint64
-	FMapUint16Uintptr     map[uint16]uintptr
-	FptrMapUint16Uintptr  *map[uint16]uintptr
-	FMapUint16Int         map[uint16]int
-	FptrMapUint16Int      *map[uint16]int
-	FMapUint16Int8        map[uint16]int8
-	FptrMapUint16Int8     *map[uint16]int8
-	FMapUint16Int16       map[uint16]int16
-	FptrMapUint16Int16    *map[uint16]int16
-	FMapUint16Int32       map[uint16]int32
-	FptrMapUint16Int32    *map[uint16]int32
-	FMapUint16Int64       map[uint16]int64
-	FptrMapUint16Int64    *map[uint16]int64
-	FMapUint16Float32     map[uint16]float32
-	FptrMapUint16Float32  *map[uint16]float32
-	FMapUint16Float64     map[uint16]float64
-	FptrMapUint16Float64  *map[uint16]float64
-	FMapUint16Bool        map[uint16]bool
-	FptrMapUint16Bool     *map[uint16]bool
-	FMapUint32Intf        map[uint32]interface{}
-	FptrMapUint32Intf     *map[uint32]interface{}
-	FMapUint32String      map[uint32]string
-	FptrMapUint32String   *map[uint32]string
-	FMapUint32Uint        map[uint32]uint
-	FptrMapUint32Uint     *map[uint32]uint
-	FMapUint32Uint8       map[uint32]uint8
-	FptrMapUint32Uint8    *map[uint32]uint8
-	FMapUint32Uint16      map[uint32]uint16
-	FptrMapUint32Uint16   *map[uint32]uint16
-	FMapUint32Uint32      map[uint32]uint32
-	FptrMapUint32Uint32   *map[uint32]uint32
-	FMapUint32Uint64      map[uint32]uint64
-	FptrMapUint32Uint64   *map[uint32]uint64
-	FMapUint32Uintptr     map[uint32]uintptr
-	FptrMapUint32Uintptr  *map[uint32]uintptr
-	FMapUint32Int         map[uint32]int
-	FptrMapUint32Int      *map[uint32]int
-	FMapUint32Int8        map[uint32]int8
-	FptrMapUint32Int8     *map[uint32]int8
-	FMapUint32Int16       map[uint32]int16
-	FptrMapUint32Int16    *map[uint32]int16
-	FMapUint32Int32       map[uint32]int32
-	FptrMapUint32Int32    *map[uint32]int32
-	FMapUint32Int64       map[uint32]int64
-	FptrMapUint32Int64    *map[uint32]int64
-	FMapUint32Float32     map[uint32]float32
-	FptrMapUint32Float32  *map[uint32]float32
-	FMapUint32Float64     map[uint32]float64
-	FptrMapUint32Float64  *map[uint32]float64
-	FMapUint32Bool        map[uint32]bool
-	FptrMapUint32Bool     *map[uint32]bool
 	FMapUint64Intf        map[uint64]interface{}
 	FptrMapUint64Intf     *map[uint64]interface{}
 	FMapUint64String      map[uint64]string
@@ -358,22 +168,12 @@ type TestMammoth2 struct {
 	FptrMapUint64Uint     *map[uint64]uint
 	FMapUint64Uint8       map[uint64]uint8
 	FptrMapUint64Uint8    *map[uint64]uint8
-	FMapUint64Uint16      map[uint64]uint16
-	FptrMapUint64Uint16   *map[uint64]uint16
-	FMapUint64Uint32      map[uint64]uint32
-	FptrMapUint64Uint32   *map[uint64]uint32
 	FMapUint64Uint64      map[uint64]uint64
 	FptrMapUint64Uint64   *map[uint64]uint64
 	FMapUint64Uintptr     map[uint64]uintptr
 	FptrMapUint64Uintptr  *map[uint64]uintptr
 	FMapUint64Int         map[uint64]int
 	FptrMapUint64Int      *map[uint64]int
-	FMapUint64Int8        map[uint64]int8
-	FptrMapUint64Int8     *map[uint64]int8
-	FMapUint64Int16       map[uint64]int16
-	FptrMapUint64Int16    *map[uint64]int16
-	FMapUint64Int32       map[uint64]int32
-	FptrMapUint64Int32    *map[uint64]int32
 	FMapUint64Int64       map[uint64]int64
 	FptrMapUint64Int64    *map[uint64]int64
 	FMapUint64Float32     map[uint64]float32
@@ -390,22 +190,12 @@ type TestMammoth2 struct {
 	FptrMapUintptrUint    *map[uintptr]uint
 	FMapUintptrUint8      map[uintptr]uint8
 	FptrMapUintptrUint8   *map[uintptr]uint8
-	FMapUintptrUint16     map[uintptr]uint16
-	FptrMapUintptrUint16  *map[uintptr]uint16
-	FMapUintptrUint32     map[uintptr]uint32
-	FptrMapUintptrUint32  *map[uintptr]uint32
 	FMapUintptrUint64     map[uintptr]uint64
 	FptrMapUintptrUint64  *map[uintptr]uint64
 	FMapUintptrUintptr    map[uintptr]uintptr
 	FptrMapUintptrUintptr *map[uintptr]uintptr
 	FMapUintptrInt        map[uintptr]int
 	FptrMapUintptrInt     *map[uintptr]int
-	FMapUintptrInt8       map[uintptr]int8
-	FptrMapUintptrInt8    *map[uintptr]int8
-	FMapUintptrInt16      map[uintptr]int16
-	FptrMapUintptrInt16   *map[uintptr]int16
-	FMapUintptrInt32      map[uintptr]int32
-	FptrMapUintptrInt32   *map[uintptr]int32
 	FMapUintptrInt64      map[uintptr]int64
 	FptrMapUintptrInt64   *map[uintptr]int64
 	FMapUintptrFloat32    map[uintptr]float32
@@ -422,22 +212,12 @@ type TestMammoth2 struct {
 	FptrMapIntUint        *map[int]uint
 	FMapIntUint8          map[int]uint8
 	FptrMapIntUint8       *map[int]uint8
-	FMapIntUint16         map[int]uint16
-	FptrMapIntUint16      *map[int]uint16
-	FMapIntUint32         map[int]uint32
-	FptrMapIntUint32      *map[int]uint32
 	FMapIntUint64         map[int]uint64
 	FptrMapIntUint64      *map[int]uint64
 	FMapIntUintptr        map[int]uintptr
 	FptrMapIntUintptr     *map[int]uintptr
 	FMapIntInt            map[int]int
 	FptrMapIntInt         *map[int]int
-	FMapIntInt8           map[int]int8
-	FptrMapIntInt8        *map[int]int8
-	FMapIntInt16          map[int]int16
-	FptrMapIntInt16       *map[int]int16
-	FMapIntInt32          map[int]int32
-	FptrMapIntInt32       *map[int]int32
 	FMapIntInt64          map[int]int64
 	FptrMapIntInt64       *map[int]int64
 	FMapIntFloat32        map[int]float32
@@ -446,102 +226,6 @@ type TestMammoth2 struct {
 	FptrMapIntFloat64     *map[int]float64
 	FMapIntBool           map[int]bool
 	FptrMapIntBool        *map[int]bool
-	FMapInt8Intf          map[int8]interface{}
-	FptrMapInt8Intf       *map[int8]interface{}
-	FMapInt8String        map[int8]string
-	FptrMapInt8String     *map[int8]string
-	FMapInt8Uint          map[int8]uint
-	FptrMapInt8Uint       *map[int8]uint
-	FMapInt8Uint8         map[int8]uint8
-	FptrMapInt8Uint8      *map[int8]uint8
-	FMapInt8Uint16        map[int8]uint16
-	FptrMapInt8Uint16     *map[int8]uint16
-	FMapInt8Uint32        map[int8]uint32
-	FptrMapInt8Uint32     *map[int8]uint32
-	FMapInt8Uint64        map[int8]uint64
-	FptrMapInt8Uint64     *map[int8]uint64
-	FMapInt8Uintptr       map[int8]uintptr
-	FptrMapInt8Uintptr    *map[int8]uintptr
-	FMapInt8Int           map[int8]int
-	FptrMapInt8Int        *map[int8]int
-	FMapInt8Int8          map[int8]int8
-	FptrMapInt8Int8       *map[int8]int8
-	FMapInt8Int16         map[int8]int16
-	FptrMapInt8Int16      *map[int8]int16
-	FMapInt8Int32         map[int8]int32
-	FptrMapInt8Int32      *map[int8]int32
-	FMapInt8Int64         map[int8]int64
-	FptrMapInt8Int64      *map[int8]int64
-	FMapInt8Float32       map[int8]float32
-	FptrMapInt8Float32    *map[int8]float32
-	FMapInt8Float64       map[int8]float64
-	FptrMapInt8Float64    *map[int8]float64
-	FMapInt8Bool          map[int8]bool
-	FptrMapInt8Bool       *map[int8]bool
-	FMapInt16Intf         map[int16]interface{}
-	FptrMapInt16Intf      *map[int16]interface{}
-	FMapInt16String       map[int16]string
-	FptrMapInt16String    *map[int16]string
-	FMapInt16Uint         map[int16]uint
-	FptrMapInt16Uint      *map[int16]uint
-	FMapInt16Uint8        map[int16]uint8
-	FptrMapInt16Uint8     *map[int16]uint8
-	FMapInt16Uint16       map[int16]uint16
-	FptrMapInt16Uint16    *map[int16]uint16
-	FMapInt16Uint32       map[int16]uint32
-	FptrMapInt16Uint32    *map[int16]uint32
-	FMapInt16Uint64       map[int16]uint64
-	FptrMapInt16Uint64    *map[int16]uint64
-	FMapInt16Uintptr      map[int16]uintptr
-	FptrMapInt16Uintptr   *map[int16]uintptr
-	FMapInt16Int          map[int16]int
-	FptrMapInt16Int       *map[int16]int
-	FMapInt16Int8         map[int16]int8
-	FptrMapInt16Int8      *map[int16]int8
-	FMapInt16Int16        map[int16]int16
-	FptrMapInt16Int16     *map[int16]int16
-	FMapInt16Int32        map[int16]int32
-	FptrMapInt16Int32     *map[int16]int32
-	FMapInt16Int64        map[int16]int64
-	FptrMapInt16Int64     *map[int16]int64
-	FMapInt16Float32      map[int16]float32
-	FptrMapInt16Float32   *map[int16]float32
-	FMapInt16Float64      map[int16]float64
-	FptrMapInt16Float64   *map[int16]float64
-	FMapInt16Bool         map[int16]bool
-	FptrMapInt16Bool      *map[int16]bool
-	FMapInt32Intf         map[int32]interface{}
-	FptrMapInt32Intf      *map[int32]interface{}
-	FMapInt32String       map[int32]string
-	FptrMapInt32String    *map[int32]string
-	FMapInt32Uint         map[int32]uint
-	FptrMapInt32Uint      *map[int32]uint
-	FMapInt32Uint8        map[int32]uint8
-	FptrMapInt32Uint8     *map[int32]uint8
-	FMapInt32Uint16       map[int32]uint16
-	FptrMapInt32Uint16    *map[int32]uint16
-	FMapInt32Uint32       map[int32]uint32
-	FptrMapInt32Uint32    *map[int32]uint32
-	FMapInt32Uint64       map[int32]uint64
-	FptrMapInt32Uint64    *map[int32]uint64
-	FMapInt32Uintptr      map[int32]uintptr
-	FptrMapInt32Uintptr   *map[int32]uintptr
-	FMapInt32Int          map[int32]int
-	FptrMapInt32Int       *map[int32]int
-	FMapInt32Int8         map[int32]int8
-	FptrMapInt32Int8      *map[int32]int8
-	FMapInt32Int16        map[int32]int16
-	FptrMapInt32Int16     *map[int32]int16
-	FMapInt32Int32        map[int32]int32
-	FptrMapInt32Int32     *map[int32]int32
-	FMapInt32Int64        map[int32]int64
-	FptrMapInt32Int64     *map[int32]int64
-	FMapInt32Float32      map[int32]float32
-	FptrMapInt32Float32   *map[int32]float32
-	FMapInt32Float64      map[int32]float64
-	FptrMapInt32Float64   *map[int32]float64
-	FMapInt32Bool         map[int32]bool
-	FptrMapInt32Bool      *map[int32]bool
 	FMapInt64Intf         map[int64]interface{}
 	FptrMapInt64Intf      *map[int64]interface{}
 	FMapInt64String       map[int64]string
@@ -550,22 +234,12 @@ type TestMammoth2 struct {
 	FptrMapInt64Uint      *map[int64]uint
 	FMapInt64Uint8        map[int64]uint8
 	FptrMapInt64Uint8     *map[int64]uint8
-	FMapInt64Uint16       map[int64]uint16
-	FptrMapInt64Uint16    *map[int64]uint16
-	FMapInt64Uint32       map[int64]uint32
-	FptrMapInt64Uint32    *map[int64]uint32
 	FMapInt64Uint64       map[int64]uint64
 	FptrMapInt64Uint64    *map[int64]uint64
 	FMapInt64Uintptr      map[int64]uintptr
 	FptrMapInt64Uintptr   *map[int64]uintptr
 	FMapInt64Int          map[int64]int
 	FptrMapInt64Int       *map[int64]int
-	FMapInt64Int8         map[int64]int8
-	FptrMapInt64Int8      *map[int64]int8
-	FMapInt64Int16        map[int64]int16
-	FptrMapInt64Int16     *map[int64]int16
-	FMapInt64Int32        map[int64]int32
-	FptrMapInt64Int32     *map[int64]int32
 	FMapInt64Int64        map[int64]int64
 	FptrMapInt64Int64     *map[int64]int64
 	FMapInt64Float32      map[int64]float32
@@ -574,38 +248,6 @@ type TestMammoth2 struct {
 	FptrMapInt64Float64   *map[int64]float64
 	FMapInt64Bool         map[int64]bool
 	FptrMapInt64Bool      *map[int64]bool
-	FMapBoolIntf          map[bool]interface{}
-	FptrMapBoolIntf       *map[bool]interface{}
-	FMapBoolString        map[bool]string
-	FptrMapBoolString     *map[bool]string
-	FMapBoolUint          map[bool]uint
-	FptrMapBoolUint       *map[bool]uint
-	FMapBoolUint8         map[bool]uint8
-	FptrMapBoolUint8      *map[bool]uint8
-	FMapBoolUint16        map[bool]uint16
-	FptrMapBoolUint16     *map[bool]uint16
-	FMapBoolUint32        map[bool]uint32
-	FptrMapBoolUint32     *map[bool]uint32
-	FMapBoolUint64        map[bool]uint64
-	FptrMapBoolUint64     *map[bool]uint64
-	FMapBoolUintptr       map[bool]uintptr
-	FptrMapBoolUintptr    *map[bool]uintptr
-	FMapBoolInt           map[bool]int
-	FptrMapBoolInt        *map[bool]int
-	FMapBoolInt8          map[bool]int8
-	FptrMapBoolInt8       *map[bool]int8
-	FMapBoolInt16         map[bool]int16
-	FptrMapBoolInt16      *map[bool]int16
-	FMapBoolInt32         map[bool]int32
-	FptrMapBoolInt32      *map[bool]int32
-	FMapBoolInt64         map[bool]int64
-	FptrMapBoolInt64      *map[bool]int64
-	FMapBoolFloat32       map[bool]float32
-	FptrMapBoolFloat32    *map[bool]float32
-	FMapBoolFloat64       map[bool]float64
-	FptrMapBoolFloat64    *map[bool]float64
-	FMapBoolBool          map[bool]bool
-	FptrMapBoolBool       *map[bool]bool
 }
 
 // -----------

Dosya farkı çok büyük olduğundan ihmal edildi
+ 176 - 589
codec/mammoth_generated_test.go


+ 119 - 0
codec/prebuild.go

@@ -0,0 +1,119 @@
+// +build prebuild
+
+package main
+
+import (
+	"bytes"
+	"go/format"
+	"io/ioutil"
+	"os"
+	"strings"
+	"text/template"
+)
+
+func genInternalSortableTypes() []string {
+	return []string{
+		"string",
+		"float32",
+		"float64",
+		"uint",
+		"uint8",
+		"uint16",
+		"uint32",
+		"uint64",
+		"uintptr",
+		"int",
+		"int8",
+		"int16",
+		"int32",
+		"int64",
+		"bool",
+		"time",
+		"bytes",
+	}
+}
+
+func genInternalSortablePlusTypes() []string {
+	return []string{
+		"string",
+		"float64",
+		"uint64",
+		"uintptr",
+		"int64",
+		"bool",
+		"time",
+		"bytes",
+	}
+}
+
+func genTypeForShortName(s string) string {
+	switch s {
+	case "time":
+		return "time.Time"
+	case "bytes":
+		return "[]byte"
+	}
+	return s
+}
+
+func genArgs(args ...interface{}) map[string]interface{} {
+	m := make(map[string]interface{}, len(args)/2)
+	for i := 0; i < len(args); {
+		m[args[i].(string)] = args[i+1]
+		i += 2
+	}
+	return m
+}
+
+func genEndsWith(s0 string, sn ...string) bool {
+	for _, s := range sn {
+		if strings.HasSuffix(s0, s) {
+			return true
+		}
+	}
+	return false
+}
+
+func chkerr(err error) {
+	if err != nil {
+		panic(err)
+	}
+}
+
+func run(fnameIn, fnameOut string) {
+	var err error
+
+	funcs := make(template.FuncMap)
+	funcs["sortables"] = genInternalSortableTypes
+	funcs["sortablesplus"] = genInternalSortablePlusTypes
+	funcs["tshort"] = genTypeForShortName
+	funcs["endswith"] = genEndsWith
+	funcs["args"] = genArgs
+
+	t := template.New("").Funcs(funcs)
+	fin, err := os.Open(fnameIn)
+	chkerr(err)
+	defer fin.Close()
+	fout, err := os.Create(fnameOut)
+	chkerr(err)
+	defer fout.Close()
+	tmplstr, err := ioutil.ReadAll(fin)
+	chkerr(err)
+	t, err = t.Parse(string(tmplstr))
+	chkerr(err)
+	var out bytes.Buffer
+	err = t.Execute(&out, 0)
+	chkerr(err)
+	bout, err := format.Source(out.Bytes())
+	if err != nil {
+		fout.Write(out.Bytes()) // write out if error, so we can still see.
+		// w.Write(bout) // write out if error, as much as possible, so we can still see.
+	}
+	chkerr(err)
+	_, err = fout.Write(bout)
+	chkerr(err)
+}
+
+func main() {
+	run("sort-slice.go.tmpl", "sort-slice.generated.go")
+}

+ 338 - 0
codec/sort-slice.generated.go

@@ -0,0 +1,338 @@
+// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+// Code generated from sort-slice.go.tmpl - DO NOT EDIT.
+
+package codec
+
+import "time"
+import "reflect"
+import "bytes"
+
+type stringSlice []string
+
+func (p stringSlice) Len() int      { return len(p) }
+func (p stringSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p stringSlice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type float32Slice []float32
+
+func (p float32Slice) Len() int      { return len(p) }
+func (p float32Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p float32Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)] || isNaN32(p[uint(i)]) && !isNaN32(p[uint(j)])
+}
+
+type float64Slice []float64
+
+func (p float64Slice) Len() int      { return len(p) }
+func (p float64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p float64Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)] || isNaN64(p[uint(i)]) && !isNaN64(p[uint(j)])
+}
+
+type uintSlice []uint
+
+func (p uintSlice) Len() int      { return len(p) }
+func (p uintSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uintSlice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type uint8Slice []uint8
+
+func (p uint8Slice) Len() int      { return len(p) }
+func (p uint8Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint8Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type uint16Slice []uint16
+
+func (p uint16Slice) Len() int      { return len(p) }
+func (p uint16Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint16Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type uint32Slice []uint32
+
+func (p uint32Slice) Len() int      { return len(p) }
+func (p uint32Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint32Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type uint64Slice []uint64
+
+func (p uint64Slice) Len() int      { return len(p) }
+func (p uint64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint64Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type uintptrSlice []uintptr
+
+func (p uintptrSlice) Len() int      { return len(p) }
+func (p uintptrSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uintptrSlice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type intSlice []int
+
+func (p intSlice) Len() int      { return len(p) }
+func (p intSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p intSlice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type int8Slice []int8
+
+func (p int8Slice) Len() int      { return len(p) }
+func (p int8Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int8Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type int16Slice []int16
+
+func (p int16Slice) Len() int      { return len(p) }
+func (p int16Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int16Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type int32Slice []int32
+
+func (p int32Slice) Len() int      { return len(p) }
+func (p int32Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int32Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type int64Slice []int64
+
+func (p int64Slice) Len() int      { return len(p) }
+func (p int64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int64Slice) Less(i, j int) bool {
+	return p[uint(i)] < p[uint(j)]
+}
+
+type boolSlice []bool
+
+func (p boolSlice) Len() int      { return len(p) }
+func (p boolSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p boolSlice) Less(i, j int) bool {
+	return !p[uint(i)] && p[uint(j)]
+}
+
+type timeSlice []time.Time
+
+func (p timeSlice) Len() int      { return len(p) }
+func (p timeSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p timeSlice) Less(i, j int) bool {
+	return p[uint(i)].Before(p[uint(j)])
+}
+
+type bytesSlice [][]byte
+
+func (p bytesSlice) Len() int      { return len(p) }
+func (p bytesSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p bytesSlice) Less(i, j int) bool {
+	return bytes.Compare(p[uint(i)], p[uint(j)]) == -1
+}
+
+type stringRv struct {
+	v string
+	r reflect.Value
+}
+type stringRvSlice []stringRv
+
+func (p stringRvSlice) Len() int      { return len(p) }
+func (p stringRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p stringRvSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type stringIntf struct {
+	v string
+	i interface{}
+}
+type stringIntfSlice []stringIntf
+
+func (p stringIntfSlice) Len() int      { return len(p) }
+func (p stringIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p stringIntfSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type float64Rv struct {
+	v float64
+	r reflect.Value
+}
+type float64RvSlice []float64Rv
+
+func (p float64RvSlice) Len() int      { return len(p) }
+func (p float64RvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p float64RvSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v || isNaN64(p[uint(i)].v) && !isNaN64(p[uint(j)].v)
+}
+
+type float64Intf struct {
+	v float64
+	i interface{}
+}
+type float64IntfSlice []float64Intf
+
+func (p float64IntfSlice) Len() int      { return len(p) }
+func (p float64IntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p float64IntfSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v || isNaN64(p[uint(i)].v) && !isNaN64(p[uint(j)].v)
+}
+
+type uint64Rv struct {
+	v uint64
+	r reflect.Value
+}
+type uint64RvSlice []uint64Rv
+
+func (p uint64RvSlice) Len() int      { return len(p) }
+func (p uint64RvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint64RvSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type uint64Intf struct {
+	v uint64
+	i interface{}
+}
+type uint64IntfSlice []uint64Intf
+
+func (p uint64IntfSlice) Len() int      { return len(p) }
+func (p uint64IntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uint64IntfSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type uintptrRv struct {
+	v uintptr
+	r reflect.Value
+}
+type uintptrRvSlice []uintptrRv
+
+func (p uintptrRvSlice) Len() int      { return len(p) }
+func (p uintptrRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uintptrRvSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type uintptrIntf struct {
+	v uintptr
+	i interface{}
+}
+type uintptrIntfSlice []uintptrIntf
+
+func (p uintptrIntfSlice) Len() int      { return len(p) }
+func (p uintptrIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p uintptrIntfSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type int64Rv struct {
+	v int64
+	r reflect.Value
+}
+type int64RvSlice []int64Rv
+
+func (p int64RvSlice) Len() int      { return len(p) }
+func (p int64RvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int64RvSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type int64Intf struct {
+	v int64
+	i interface{}
+}
+type int64IntfSlice []int64Intf
+
+func (p int64IntfSlice) Len() int      { return len(p) }
+func (p int64IntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p int64IntfSlice) Less(i, j int) bool {
+	return p[uint(i)].v < p[uint(j)].v
+}
+
+type boolRv struct {
+	v bool
+	r reflect.Value
+}
+type boolRvSlice []boolRv
+
+func (p boolRvSlice) Len() int      { return len(p) }
+func (p boolRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p boolRvSlice) Less(i, j int) bool {
+	return !p[uint(i)].v && p[uint(j)].v
+}
+
+type boolIntf struct {
+	v bool
+	i interface{}
+}
+type boolIntfSlice []boolIntf
+
+func (p boolIntfSlice) Len() int      { return len(p) }
+func (p boolIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p boolIntfSlice) Less(i, j int) bool {
+	return !p[uint(i)].v && p[uint(j)].v
+}
+
+type timeRv struct {
+	v time.Time
+	r reflect.Value
+}
+type timeRvSlice []timeRv
+
+func (p timeRvSlice) Len() int      { return len(p) }
+func (p timeRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p timeRvSlice) Less(i, j int) bool {
+	return p[uint(i)].v.Before(p[uint(j)].v)
+}
+
+type timeIntf struct {
+	v time.Time
+	i interface{}
+}
+type timeIntfSlice []timeIntf
+
+func (p timeIntfSlice) Len() int      { return len(p) }
+func (p timeIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p timeIntfSlice) Less(i, j int) bool {
+	return p[uint(i)].v.Before(p[uint(j)].v)
+}
+
+type bytesRv struct {
+	v []byte
+	r reflect.Value
+}
+type bytesRvSlice []bytesRv
+
+func (p bytesRvSlice) Len() int      { return len(p) }
+func (p bytesRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p bytesRvSlice) Less(i, j int) bool {
+	return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1
+}
+
+type bytesIntf struct {
+	v []byte
+	i interface{}
+}
+type bytesIntfSlice []bytesIntf
+
+func (p bytesIntfSlice) Len() int      { return len(p) }
+func (p bytesIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p bytesIntfSlice) Less(i, j int) bool {
+	return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1
+}

+ 64 - 0
codec/sort-slice.go.tmpl

@@ -0,0 +1,64 @@
+// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
+// Use of this source code is governed by a MIT license found in the LICENSE file.
+
+// Code generated from sort-slice.go.tmpl - DO NOT EDIT.
+
+{{/*
+xxxSlice
+xxxIntf
+xxxIntfSlice
+xxxRv
+xxxRvSlice
+
+I'm not going to create them for
+- sortables
+- sortablesplus
+
+With the parameters passed in sortables or sortablesplus,
+'time, 'bytes' are special, and correspond to time.Time and []byte respectively.
+*/}}
+
+package codec
+
+import "time"
+import "reflect"
+import "bytes"
+
+{{/* func init() { _ = time.Unix } */}}
+
+{{define "T"}}
+func (p {{ .Type }}) Len() int           { return len(p) }
+func (p {{ .Type }}) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
+func (p {{ .Type }}) Less(i, j int) bool {
+	{{ if eq .Kind "bool"         }} return !p[uint(i)]{{.V}} && p[uint(j)]{{.V}}
+    {{ else if eq .Kind "float32" }} return p[uint(i)]{{.V}} < p[uint(j)]{{.V}} || isNaN32(p[uint(i)]{{.V}}) && !isNaN32(p[uint(j)]{{.V}})
+    {{ else if eq .Kind "float64" }} return p[uint(i)]{{.V}} < p[uint(j)]{{.V}} || isNaN64(p[uint(i)]{{.V}}) && !isNaN64(p[uint(j)]{{.V}})
+    {{ else if eq .Kind "time"    }} return p[uint(i)]{{.V}}.Before(p[uint(j)]{{.V}})
+    {{ else if eq .Kind "bytes"   }} return bytes.Compare(p[uint(i)]{{.V}}, p[uint(j)]{{.V}}) == -1
+    {{ else                    }} return p[uint(i)]{{.V}} < p[uint(j)]{{.V}}
+    {{ end -}}
+}
+{{end}}
+
+{{range $i, $v := sortables }}{{ $t := tshort $v }}
+type {{ $v }}Slice []{{ $t }}
+{{template "T" args "Kind" $v "Type" (print $v "Slice") "V" ""}}
+{{end}}
+
+{{range $i, $v := sortablesplus }}{{ $t := tshort $v }}
+
+type {{ $v }}Rv struct {
+	v {{ $t }}
+	r reflect.Value
+}
+type {{ $v }}RvSlice []{{ $v }}Rv
+{{template "T" args "Kind" $v "Type" (print $v "RvSlice") "V" ".v"}}
+
+type {{ $v }}Intf struct {
+	v {{ $t }}
+	i interface{}
+}
+type {{ $v }}IntfSlice []{{ $v }}Intf
+{{template "T" args "Kind" $v "Type" (print $v "IntfSlice") "V" ".v"}}
+
+{{end}}

+ 125 - 48
codec/values_codecgen_generated_test.go

@@ -650,7 +650,7 @@ func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 					}
 				}
 			} else {
@@ -666,7 +666,7 @@ func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 					}
 				}
 			}
@@ -752,7 +752,7 @@ func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16N, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 					}
 				}
 			} else {
@@ -768,7 +768,7 @@ func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16N, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 					}
 				}
 			}
@@ -779,7 +779,7 @@ func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16E, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 					}
 				}
 			} else {
@@ -795,7 +795,7 @@ func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16E, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 					}
 				}
 			}
@@ -931,7 +931,7 @@ func (x *AnonInTestStruc) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 				}
 			}
 		case "AI64arr0":
@@ -967,7 +967,7 @@ func (x *AnonInTestStruc) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16N, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 				}
 			}
 		case "AMSU16E":
@@ -976,7 +976,7 @@ func (x *AnonInTestStruc) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16E, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 				}
 			}
 		default:
@@ -1168,7 +1168,7 @@ func (x *AnonInTestStruc) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 		}
 	}
 	yyj30++
@@ -1244,7 +1244,7 @@ func (x *AnonInTestStruc) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16N, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 		}
 	}
 	yyj30++
@@ -1263,7 +1263,7 @@ func (x *AnonInTestStruc) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16E, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 		}
 	}
 	for {
@@ -3100,7 +3100,7 @@ func (x *TestStrucCommon) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 					}
 				}
 			} else {
@@ -3116,7 +3116,7 @@ func (x *TestStrucCommon) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 					}
 				}
 			}
@@ -3202,7 +3202,7 @@ func (x *TestStrucCommon) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16N, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 					}
 				}
 			} else {
@@ -3218,7 +3218,7 @@ func (x *TestStrucCommon) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16N, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 					}
 				}
 			}
@@ -3229,7 +3229,7 @@ func (x *TestStrucCommon) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16E, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 					}
 				}
 			} else {
@@ -3245,7 +3245,7 @@ func (x *TestStrucCommon) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16E, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 					}
 				}
 			}
@@ -3704,7 +3704,7 @@ func (x *TestStrucCommon) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 				}
 			}
 		case "AI64arr0":
@@ -3740,7 +3740,7 @@ func (x *TestStrucCommon) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16N, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 				}
 			}
 		case "AMSU16E":
@@ -3749,7 +3749,7 @@ func (x *TestStrucCommon) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16E, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 				}
 			}
 		case "NotAnon":
@@ -4490,7 +4490,7 @@ func (x *TestStrucCommon) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 		}
 	}
 	yyj77++
@@ -4566,7 +4566,7 @@ func (x *TestStrucCommon) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16N, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 		}
 	}
 	yyj77++
@@ -4585,7 +4585,7 @@ func (x *TestStrucCommon) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16E, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 		}
 	}
 	yyj77++
@@ -5587,7 +5587,7 @@ func (x *TestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 					}
 				}
 			} else {
@@ -5603,7 +5603,7 @@ func (x *TestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 					}
 				}
 			}
@@ -5689,7 +5689,7 @@ func (x *TestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16N, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 					}
 				}
 			} else {
@@ -5705,7 +5705,7 @@ func (x *TestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16N, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 					}
 				}
 			}
@@ -5716,7 +5716,7 @@ func (x *TestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16E, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 					}
 				}
 			} else {
@@ -5732,7 +5732,7 @@ func (x *TestStruc) CodecEncodeSelf(e *Encoder) {
 				} else {
 					if false {
 					} else {
-						z.F.EncMapStringUint16V(x.AMSU16E, e)
+						h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 					}
 				}
 			}
@@ -6308,7 +6308,7 @@ func (x *TestStruc) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 				}
 			}
 		case "AI64arr0":
@@ -6344,7 +6344,7 @@ func (x *TestStruc) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16N, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 				}
 			}
 		case "AMSU16E":
@@ -6353,7 +6353,7 @@ func (x *TestStruc) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16E, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 				}
 			}
 		case "NotAnon":
@@ -7133,7 +7133,7 @@ func (x *TestStruc) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 		}
 	}
 	yyj84++
@@ -7209,7 +7209,7 @@ func (x *TestStruc) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16N, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 		}
 	}
 	yyj84++
@@ -7228,7 +7228,7 @@ func (x *TestStruc) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16E, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 		}
 	}
 	yyj84++
@@ -10877,7 +10877,7 @@ func (x *TestStrucFlex) CodecEncodeSelf(e *Encoder) {
 					} else {
 						if false {
 						} else {
-							z.F.EncMapStringUint16V(x.AMSU16, e)
+							h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 						}
 					}
 				} else {
@@ -10897,7 +10897,7 @@ func (x *TestStrucFlex) CodecEncodeSelf(e *Encoder) {
 					} else {
 						if false {
 						} else {
-							z.F.EncMapStringUint16V(x.AMSU16, e)
+							h.encMapstringuint16((map[string]uint16)(x.AMSU16), e)
 						}
 					}
 				}
@@ -11003,7 +11003,7 @@ func (x *TestStrucFlex) CodecEncodeSelf(e *Encoder) {
 					} else {
 						if false {
 						} else {
-							z.F.EncMapStringUint16V(x.AMSU16N, e)
+							h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 						}
 					}
 				} else {
@@ -11023,7 +11023,7 @@ func (x *TestStrucFlex) CodecEncodeSelf(e *Encoder) {
 					} else {
 						if false {
 						} else {
-							z.F.EncMapStringUint16V(x.AMSU16N, e)
+							h.encMapstringuint16((map[string]uint16)(x.AMSU16N), e)
 						}
 					}
 				}
@@ -11036,7 +11036,7 @@ func (x *TestStrucFlex) CodecEncodeSelf(e *Encoder) {
 					} else {
 						if false {
 						} else {
-							z.F.EncMapStringUint16V(x.AMSU16E, e)
+							h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 						}
 					}
 				} else {
@@ -11056,7 +11056,7 @@ func (x *TestStrucFlex) CodecEncodeSelf(e *Encoder) {
 					} else {
 						if false {
 						} else {
-							z.F.EncMapStringUint16V(x.AMSU16E, e)
+							h.encMapstringuint16((map[string]uint16)(x.AMSU16E), e)
 						}
 					}
 				}
@@ -12420,7 +12420,7 @@ func (x *TestStrucFlex) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 				}
 			}
 		case "AI64arr0":
@@ -12456,7 +12456,7 @@ func (x *TestStrucFlex) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16N, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 				}
 			}
 		case "AMSU16E":
@@ -12465,7 +12465,7 @@ func (x *TestStrucFlex) codecDecodeSelfFromMap(l int, d *Decoder) {
 			} else {
 				if false {
 				} else {
-					z.F.DecMapStringUint16X(&x.AMSU16E, d)
+					h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 				}
 			}
 		case "NotAnon":
@@ -13471,7 +13471,7 @@ func (x *TestStrucFlex) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16), d)
 		}
 	}
 	yyj123++
@@ -13547,7 +13547,7 @@ func (x *TestStrucFlex) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16N, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16N), d)
 		}
 	}
 	yyj123++
@@ -13566,7 +13566,7 @@ func (x *TestStrucFlex) codecDecodeSelfFromArray(l int, d *Decoder) {
 	} else {
 		if false {
 		} else {
-			z.F.DecMapStringUint16X(&x.AMSU16E, d)
+			h.decMapstringuint16((*map[string]uint16)(&x.AMSU16E), d)
 		}
 	}
 	yyj123++
@@ -14551,6 +14551,83 @@ func (x codecSelfer19780) decwrapStringSlice(v *wrapStringSlice, d *Decoder) {
 	}
 }
 
+func (x codecSelfer19780) encMapstringuint16(v map[string]uint16, e *Encoder) {
+	var h codecSelfer19780
+	z, r := GenHelperEncoder(e)
+	_, _, _ = h, z, r
+	r.WriteMapStart(len(v))
+	for yyk1, yyv1 := range v {
+		r.WriteMapElemKey()
+		if false {
+		} else {
+			if z.EncBasicHandle().StringToRaw {
+				r.EncodeStringBytesRaw(z.BytesView(string(yyk1)))
+			} else {
+				r.EncodeStringEnc(codecSelferCcUTF819780, string(yyk1))
+			}
+		}
+		r.WriteMapElemValue()
+		if false {
+		} else {
+			r.EncodeUint(uint64(yyv1))
+		}
+	}
+	r.WriteMapEnd()
+}
+
+func (x codecSelfer19780) decMapstringuint16(v *map[string]uint16, d *Decoder) {
+	var h codecSelfer19780
+	z, r := GenHelperDecoder(d)
+	_, _, _ = h, z, r
+
+	yyv1 := *v
+	yyl1 := r.ReadMapStart()
+	yybh1 := z.DecBasicHandle()
+	if yyv1 == nil {
+		yyrl1 := z.DecInferLen(yyl1, yybh1.MaxInitLen, 18)
+		yyv1 = make(map[string]uint16, yyrl1)
+		*v = yyv1
+	}
+	var yymk1 string
+	var yymv1 uint16
+	var yymg1, yymdn1 bool
+	if yybh1.MapValueReset {
+	}
+	if yyl1 != 0 {
+		yyhl1 := yyl1 > 0
+		for yyj1 := 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ {
+			r.ReadMapElemKey()
+			if r.TryDecodeAsNil() {
+				yymk1 = ""
+			} else {
+				yymk1 = (string)(r.DecodeString())
+			}
+
+			if yymg1 {
+				yymv1 = yyv1[yymk1]
+			}
+			r.ReadMapElemValue()
+			yymdn1 = false
+			if r.TryDecodeAsNil() {
+				yymdn1 = true
+			} else {
+				yymv1 = (uint16)(z.C.UintV(r.DecodeUint64(), 16))
+			}
+
+			if yymdn1 {
+				if yybh1.DeleteOnNilMapValue {
+					delete(yyv1, yymk1)
+				} else {
+					yyv1[yymk1] = 0
+				}
+			} else if yyv1 != nil {
+				yyv1[yymk1] = yymv1
+			}
+		}
+	} // else len==0: TODO: Should we clear map entries?
+	r.ReadMapEnd()
+}
+
 func (x codecSelfer19780) encArray0int64(v *[0]int64, e *Encoder) {
 	var h codecSelfer19780
 	z, r := GenHelperEncoder(e)

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor