Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit 0195110

Browse files
committed
gofmt
1 parent 55fc498 commit 0195110

10 files changed

+14
-16
lines changed

example_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func ExampleUnmarshal() {
4646
// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
4747
}
4848

49-
5049
func ExampleMarshalWithBestPerformance() {
5150
type ColorGroup struct {
5251
ID int
@@ -88,4 +87,4 @@ func ExampleUnmarshalWithBestPerformance() {
8887
fmt.Printf("%+v", animals)
8988
// Output:
9089
// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
91-
}
90+
}

feature_any_array.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
type arrayLazyAny struct {
1010
baseAny
11-
cfg *frozenConfig
11+
cfg *frozenConfig
1212
buf []byte
1313
err error
1414
cache []Any

feature_any_int64.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
type int64LazyAny struct {
1010
baseAny
11-
cfg *frozenConfig
11+
cfg *frozenConfig
1212
buf []byte
1313
err error
1414
cache int64

feature_any_object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
type objectLazyAny struct {
1010
baseAny
11-
cfg *frozenConfig
11+
cfg *frozenConfig
1212
buf []byte
1313
err error
1414
cache map[string]Any

feature_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package jsoniter
22

33
import (
4+
"errors"
45
"io"
56
"reflect"
67
"sync/atomic"
78
"unsafe"
8-
"errors"
99
)
1010

1111
type Config struct {

feature_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (cfg *frozenConfig) ReturnStream(stream *Stream) {
2323

2424
func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator {
2525
select {
26-
case iter := <- cfg.iteratorPool:
26+
case iter := <-cfg.iteratorPool:
2727
iter.ResetBytes(data)
2828
return iter
2929
default:

feature_reflect_map.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"encoding"
55
"encoding/json"
66
"reflect"
7+
"sort"
78
"strconv"
89
"unsafe"
9-
"sort"
1010
)
1111

1212
type mapDecoder struct {
@@ -151,7 +151,6 @@ func (encoder *sortKeysMapEncoder) encode(ptr unsafe.Pointer, stream *Stream) {
151151
realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
152152
realVal := reflect.ValueOf(*realInterface)
153153

154-
155154
// Extract and sort the keys.
156155
var sv stringValues = realVal.MapKeys()
157156
sort.Sort(sv)

jsoniter_bool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package jsoniter
22

33
import (
44
"bytes"
5+
"encoding/json"
56
"github.com/json-iterator/go/require"
67
"testing"
7-
"encoding/json"
88
)
99

1010
func Test_true(t *testing.T) {

jsoniter_map_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ func Test_map_key_with_escaped_char(t *testing.T) {
128128

129129
func Test_encode_map_with_sorted_keys(t *testing.T) {
130130
should := require.New(t)
131-
m := map[string]interface{}{
132-
"3": 3,
133-
"1": 1,
134-
"2": 2,
135-
}
131+
m := map[string]interface{}{
132+
"3": 3,
133+
"1": 1,
134+
"2": 2,
135+
}
136136
bytes, err := json.Marshal(m)
137137
should.Nil(err)
138138
output, err := ConfigCompatibleWithStandardLibrary.MarshalToString(m)

jsoniter_string_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func Test_string_encode_with_std_without_html_escape(t *testing.T) {
147147
err := encoder.Encode(input)
148148
should.Nil(err)
149149
stdOutput := buf.String()
150-
stdOutput = stdOutput[:len(stdOutput) - 1]
150+
stdOutput = stdOutput[:len(stdOutput)-1]
151151
jsoniterOutputBytes, err := Marshal(input)
152152
should.Nil(err)
153153
jsoniterOutput := string(jsoniterOutputBytes)

0 commit comments

Comments
 (0)