1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-06 22:36:25 +02:00
This commit is contained in:
Tao Wen 2017-06-17 21:11:23 +08:00
parent 55fc498d27
commit 0195110b5b
10 changed files with 14 additions and 16 deletions

View File

@ -46,7 +46,6 @@ func ExampleUnmarshal() {
// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}] // [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
} }
func ExampleMarshalWithBestPerformance() { func ExampleMarshalWithBestPerformance() {
type ColorGroup struct { type ColorGroup struct {
ID int ID int

View File

@ -1,11 +1,11 @@
package jsoniter package jsoniter
import ( import (
"errors"
"io" "io"
"reflect" "reflect"
"sync/atomic" "sync/atomic"
"unsafe" "unsafe"
"errors"
) )
type Config struct { type Config struct {

View File

@ -4,9 +4,9 @@ import (
"encoding" "encoding"
"encoding/json" "encoding/json"
"reflect" "reflect"
"sort"
"strconv" "strconv"
"unsafe" "unsafe"
"sort"
) )
type mapDecoder struct { type mapDecoder struct {
@ -151,7 +151,6 @@ func (encoder *sortKeysMapEncoder) encode(ptr unsafe.Pointer, stream *Stream) {
realInterface := (*interface{})(unsafe.Pointer(&mapInterface)) realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
realVal := reflect.ValueOf(*realInterface) realVal := reflect.ValueOf(*realInterface)
// Extract and sort the keys. // Extract and sort the keys.
var sv stringValues = realVal.MapKeys() var sv stringValues = realVal.MapKeys()
sort.Sort(sv) sort.Sort(sv)

View File

@ -2,9 +2,9 @@ package jsoniter
import ( import (
"bytes" "bytes"
"encoding/json"
"github.com/json-iterator/go/require" "github.com/json-iterator/go/require"
"testing" "testing"
"encoding/json"
) )
func Test_true(t *testing.T) { func Test_true(t *testing.T) {