|
@@ -18,7 +18,6 @@ package codec
|
|
|
import (
|
|
import (
|
|
|
"math"
|
|
"math"
|
|
|
"strings"
|
|
"strings"
|
|
|
- "time"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
type wrapSliceUint64 []uint64
|
|
type wrapSliceUint64 []uint64
|
|
@@ -56,13 +55,6 @@ type AnonInTestStruc struct {
|
|
|
AMSU16E map[string]uint16
|
|
AMSU16E map[string]uint16
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type AnonInTestStrucIntf struct {
|
|
|
|
|
- Islice []interface{}
|
|
|
|
|
- Ms map[string]interface{}
|
|
|
|
|
- Nintf interface{} //don't set this, so we can test for nil
|
|
|
|
|
- T time.Time
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
type testSimpleFields struct {
|
|
type testSimpleFields struct {
|
|
|
S string
|
|
S string
|
|
|
|
|
|
|
@@ -154,11 +146,6 @@ type TestStrucCommon struct {
|
|
|
|
|
|
|
|
NotAnon AnonInTestStruc
|
|
NotAnon AnonInTestStruc
|
|
|
|
|
|
|
|
- // make this a ptr, so that it could be set or not.
|
|
|
|
|
- // for comparison (e.g. with msgp), give it a struct tag (so it is not inlined),
|
|
|
|
|
- // make this one omitempty (so it is excluded if nil).
|
|
|
|
|
- *AnonInTestStrucIntf `json:",omitempty"`
|
|
|
|
|
-
|
|
|
|
|
// R Raw // Testing Raw must be explicitly turned on, so use standalone test
|
|
// R Raw // Testing Raw must be explicitly turned on, so use standalone test
|
|
|
// Rext RawExt // Testing RawExt is tricky, so use standalone test
|
|
// Rext RawExt // Testing RawExt is tricky, so use standalone test
|
|
|
|
|
|
|
@@ -178,8 +165,6 @@ type TestStruc struct {
|
|
|
Nteststruc *TestStruc
|
|
Nteststruc *TestStruc
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-var testStrucTime = time.Date(2012, 2, 2, 2, 2, 2, 2000, time.UTC).UTC()
|
|
|
|
|
-
|
|
|
|
|
func populateTestStrucCommon(ts *TestStrucCommon, n int, bench, useInterface, useStringKeyOnly bool) {
|
|
func populateTestStrucCommon(ts *TestStrucCommon, n int, bench, useInterface, useStringKeyOnly bool) {
|
|
|
var i64a, i64b, i64c, i64d int64 = 64, 6464, 646464, 64646464
|
|
var i64a, i64b, i64c, i64d int64 = 64, 6464, 646464, 64646464
|
|
|
|
|
|
|
@@ -373,17 +358,6 @@ func populateTestStrucCommon(ts *TestStrucCommon, n int, bench, useInterface, us
|
|
|
ts.Simplef.Ui64 = ts.Ui64
|
|
ts.Simplef.Ui64 = ts.Ui64
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if useInterface {
|
|
|
|
|
- ts.AnonInTestStrucIntf = &AnonInTestStrucIntf{
|
|
|
|
|
- Islice: []interface{}{strRpt(n, "true"), true, strRpt(n, "no"), false, uint64(288), float64(0.4)},
|
|
|
|
|
- Ms: map[string]interface{}{
|
|
|
|
|
- strRpt(n, "true"): strRpt(n, "true"),
|
|
|
|
|
- strRpt(n, "int64(9)"): false,
|
|
|
|
|
- },
|
|
|
|
|
- T: testStrucTime,
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
//For benchmarks, some things will not work.
|
|
//For benchmarks, some things will not work.
|
|
|
if !bench {
|
|
if !bench {
|
|
|
//json and bson require string keys in maps
|
|
//json and bson require string keys in maps
|