Tao Wen há 8 anos atrás
pai
commit
0195110b5b

+ 1 - 2
example_test.go

@@ -46,7 +46,6 @@ func ExampleUnmarshal() {
 	// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
 }
 
-
 func ExampleMarshalWithBestPerformance() {
 	type ColorGroup struct {
 		ID     int
@@ -88,4 +87,4 @@ func ExampleUnmarshalWithBestPerformance() {
 	fmt.Printf("%+v", animals)
 	// Output:
 	// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
-}
+}

+ 1 - 1
feature_any_array.go

@@ -8,7 +8,7 @@ import (
 
 type arrayLazyAny struct {
 	baseAny
-	cfg	*frozenConfig
+	cfg       *frozenConfig
 	buf       []byte
 	err       error
 	cache     []Any

+ 1 - 1
feature_any_int64.go

@@ -8,7 +8,7 @@ import (
 
 type int64LazyAny struct {
 	baseAny
-	cfg	*frozenConfig
+	cfg   *frozenConfig
 	buf   []byte
 	err   error
 	cache int64

+ 1 - 1
feature_any_object.go

@@ -8,7 +8,7 @@ import (
 
 type objectLazyAny struct {
 	baseAny
-	cfg	*frozenConfig
+	cfg       *frozenConfig
 	buf       []byte
 	err       error
 	cache     map[string]Any

+ 1 - 1
feature_config.go

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

+ 1 - 1
feature_pool.go

@@ -23,7 +23,7 @@ func (cfg *frozenConfig) ReturnStream(stream *Stream) {
 
 func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator {
 	select {
-	case iter := <- cfg.iteratorPool:
+	case iter := <-cfg.iteratorPool:
 		iter.ResetBytes(data)
 		return iter
 	default:

+ 1 - 2
feature_reflect_map.go

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

+ 1 - 1
jsoniter_bool_test.go

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

+ 5 - 5
jsoniter_map_test.go

@@ -128,11 +128,11 @@ func Test_map_key_with_escaped_char(t *testing.T) {
 
 func Test_encode_map_with_sorted_keys(t *testing.T) {
 	should := require.New(t)
-m := map[string]interface{}{
-	"3": 3,
-	"1": 1,
-	"2": 2,
-}
+	m := map[string]interface{}{
+		"3": 3,
+		"1": 1,
+		"2": 2,
+	}
 	bytes, err := json.Marshal(m)
 	should.Nil(err)
 	output, err := ConfigCompatibleWithStandardLibrary.MarshalToString(m)

+ 1 - 1
jsoniter_string_test.go

@@ -147,7 +147,7 @@ func Test_string_encode_with_std_without_html_escape(t *testing.T) {
 		err := encoder.Encode(input)
 		should.Nil(err)
 		stdOutput := buf.String()
-		stdOutput = stdOutput[:len(stdOutput) - 1]
+		stdOutput = stdOutput[:len(stdOutput)-1]
 		jsoniterOutputBytes, err := Marshal(input)
 		should.Nil(err)
 		jsoniterOutput := string(jsoniterOutputBytes)