Skip to content

Commit fff342f

Browse files
committed
gofmt
1 parent 8d6662b commit fff342f

File tree

72 files changed

+163
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+163
-174
lines changed

any.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package jsoniter
33
import (
44
"errors"
55
"fmt"
6+
"github.com/v2pro/plz/reflect2"
67
"io"
78
"reflect"
8-
"unsafe"
9-
"github.com/v2pro/plz/reflect2"
109
"strconv"
10+
"unsafe"
1111
)
1212

1313
// Any generic object representation.

any_tests/jsoniter_any_array_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package any_tests
33
import (
44
"testing"
55

6-
"github.com/stretchr/testify/require"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
)
99

1010
func Test_read_empty_array_as_any(t *testing.T) {

any_tests/jsoniter_any_bool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/stretchr/testify/require"
87
"github.com/json-iterator/go"
8+
"github.com/stretchr/testify/require"
99
)
1010

1111
var boolConvertMap = map[string]bool{

any_tests/jsoniter_any_float_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package any_tests
33
import (
44
"testing"
55

6-
"github.com/stretchr/testify/require"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
)
99

1010
var floatConvertMap = map[string]float64{

any_tests/jsoniter_any_int_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/stretchr/testify/require"
87
"github.com/json-iterator/go"
8+
"github.com/stretchr/testify/require"
99
)
1010

1111
var intConvertMap = map[string]int{

any_tests/jsoniter_any_map_test.go

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

33
import (
4+
"github.com/json-iterator/go"
45
"github.com/stretchr/testify/require"
56
"testing"
6-
"github.com/json-iterator/go"
77
)
88

99
func Test_wrap_map(t *testing.T) {

any_tests/jsoniter_any_null_test.go

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

33
import (
4+
"github.com/json-iterator/go"
45
"github.com/stretchr/testify/require"
56
"testing"
6-
"github.com/json-iterator/go"
77
)
88

99
func Test_read_null_as_any(t *testing.T) {

any_tests/jsoniter_any_object_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package any_tests
33
import (
44
"testing"
55

6-
"github.com/stretchr/testify/require"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
)
99

1010
func Test_read_object_as_any(t *testing.T) {
@@ -120,4 +120,4 @@ func Test_object_wrapper_any_get_all(t *testing.T) {
120120
should.NotContains(any.Keys(), "Field3")
121121

122122
//should.Contains(any.GetObject()["Field1"].GetArray()[0], 1)
123-
}
123+
}

any_tests/jsoniter_any_string_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package any_tests
33
import (
44
"testing"
55

6-
"github.com/stretchr/testify/require"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
)
99

1010
var stringConvertMap = map[string]string{

any_tests/jsoniter_must_be_valid_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package any_tests
33
import (
44
"testing"
55

6-
"github.com/stretchr/testify/require"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
)
99

1010
// if must be valid is useless, just drop this test

any_tests/jsoniter_wrap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package any_tests
33
import (
44
"testing"
55

6-
"github.com/stretchr/testify/require"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
)
99

1010
func Test_wrap_and_valuetype_everything(t *testing.T) {

api_tests/config_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package test
22

33
import (
4-
"testing"
5-
"github.com/stretchr/testify/require"
6-
"github.com/json-iterator/go"
74
"encoding/json"
5+
"github.com/json-iterator/go"
6+
"github.com/stretchr/testify/require"
7+
"testing"
88
)
99

1010
func Test_use_number_for_unmarshal(t *testing.T) {
@@ -23,7 +23,6 @@ func Test_customize_float_marshal(t *testing.T) {
2323
should.Equal("1.234568", str)
2424
}
2525

26-
2726
func Test_customize_tag_key(t *testing.T) {
2827

2928
type TestObject struct {
@@ -45,4 +44,4 @@ func Test_read_large_number_as_interface(t *testing.T) {
4544
output, err := jsoniter.MarshalToString(val)
4645
should.Nil(err)
4746
should.Equal(`123456789123456789123456789`, output)
48-
}
47+
}

api_tests/decoder_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package test
22

33
import (
44
"bytes"
5-
"github.com/stretchr/testify/require"
6-
"testing"
5+
"encoding/json"
76
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
88
"io/ioutil"
9-
"encoding/json"
9+
"testing"
1010
)
1111

1212
func Test_disallowUnknownFields(t *testing.T) {
@@ -18,7 +18,6 @@ func Test_disallowUnknownFields(t *testing.T) {
1818
should.Error(decoder.Decode(&obj))
1919
}
2020

21-
2221
func Test_new_decoder(t *testing.T) {
2322
should := require.New(t)
2423
decoder1 := json.NewDecoder(bytes.NewBufferString(`[1][2]`))

api_tests/encoder_18_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"testing"
99
"unicode/utf8"
1010

11-
"github.com/stretchr/testify/require"
1211
"github.com/json-iterator/go"
12+
"github.com/stretchr/testify/require"
1313
)
1414

1515
func Test_new_encoder(t *testing.T) {

api_tests/encoder_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package test
22

33
import (
4-
"testing"
5-
"github.com/stretchr/testify/require"
64
"bytes"
7-
"github.com/json-iterator/go"
85
"encoding/json"
6+
"github.com/json-iterator/go"
7+
"github.com/stretchr/testify/require"
8+
"testing"
99
)
1010

1111
// Standard Encoder has trailing newline.
@@ -17,4 +17,4 @@ func TestEncoderHasTrailingNewline(t *testing.T) {
1717
stdenc := json.NewEncoder(&stdbuf)
1818
stdenc.Encode(1)
1919
should.Equal(stdbuf.Bytes(), buf.Bytes())
20-
}
20+
}

api_tests/marshal_indent_test.go

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

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

1010
func Test_marshal_indent(t *testing.T) {

benchmarks/jsoniter_large_file_test.go

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

33
import (
44
"encoding/json"
5+
"github.com/json-iterator/go"
56
"io/ioutil"
67
"os"
78
"testing"
8-
"github.com/json-iterator/go"
99
)
1010

1111
//func Test_large_file(t *testing.T) {

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package jsoniter
22

33
import (
44
"encoding/json"
5-
"io"
6-
"unsafe"
75
"github.com/v2pro/plz/reflect2"
6+
"io"
87
"sync"
8+
"unsafe"
99
)
1010

1111
// Config customize how the API should behave.

example_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ func ExampleMapKey() {
111111

112112
type MyKey string
113113

114-
115114
func (m *MyKey) MarshalText() ([]byte, error) {
116115
return []byte(strings.Replace(string(*m), "h", "H", -1)), nil
117116
}
@@ -120,4 +119,3 @@ func (m *MyKey) UnmarshalText(text []byte) error {
120119
*m = MyKey(text[:3])
121120
return nil
122121
}
123-

extension_tests/decoder_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package test
22

33
import (
4-
"testing"
5-
"unsafe"
6-
"time"
74
"github.com/json-iterator/go"
85
"github.com/stretchr/testify/require"
96
"strconv"
7+
"testing"
8+
"time"
9+
"unsafe"
1010
)
1111

1212
func Test_customize_type_decoder(t *testing.T) {
@@ -61,7 +61,6 @@ func Test_customize_field_decoder(t *testing.T) {
6161
}
6262
}
6363

64-
6564
func Test_recursive_empty_interface_customization(t *testing.T) {
6665
t.Skip()
6766
var obj interface{}
@@ -98,4 +97,4 @@ func Test_read_custom_interface(t *testing.T) {
9897
err := jsoniter.UnmarshalFromString(`"hello"`, &val)
9998
should.Nil(err)
10099
should.Equal("hello", val.Hello())
101-
}
100+
}

extension_tests/extension_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package test
22

33
import (
4-
"unsafe"
5-
"strconv"
6-
"testing"
7-
"github.com/stretchr/testify/require"
84
"github.com/json-iterator/go"
5+
"github.com/stretchr/testify/require"
96
"github.com/v2pro/plz/reflect2"
107
"reflect"
8+
"strconv"
9+
"testing"
10+
"unsafe"
1111
)
1212

1313
type TestObject1 struct {

misc_tests/jsoniter_array_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package misc_tests
33
import (
44
"bytes"
55
"encoding/json"
6+
"github.com/json-iterator/go"
67
"github.com/stretchr/testify/require"
78
"testing"
8-
"github.com/json-iterator/go"
99
)
1010

1111
func Test_empty_array(t *testing.T) {

misc_tests/jsoniter_bool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"bytes"
55
"testing"
66

7-
"github.com/stretchr/testify/require"
87
"github.com/json-iterator/go"
8+
"github.com/stretchr/testify/require"
99
)
1010

1111
func Test_true(t *testing.T) {
@@ -44,4 +44,4 @@ func Test_write_val_bool(t *testing.T) {
4444
should.Equal(stream.Buffered(), 0)
4545
should.Nil(stream.Error)
4646
should.Equal("true", buf.String())
47-
}
47+
}

misc_tests/jsoniter_float_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"encoding/json"
55
"testing"
66

7-
"github.com/stretchr/testify/require"
87
"github.com/json-iterator/go"
8+
"github.com/stretchr/testify/require"
99
)
1010

1111
func Test_read_big_float(t *testing.T) {

misc_tests/jsoniter_int_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"strconv"
1010
"testing"
1111

12-
"github.com/stretchr/testify/require"
1312
"github.com/json-iterator/go"
13+
"github.com/stretchr/testify/require"
1414
)
1515

1616
func Test_read_uint64_invalid(t *testing.T) {

misc_tests/jsoniter_interface_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package misc_tests
22

33
import (
44
"encoding/json"
5-
"testing"
6-
"github.com/stretchr/testify/require"
75
"github.com/json-iterator/go"
6+
"github.com/stretchr/testify/require"
87
"io"
8+
"testing"
99
)
1010

1111
func Test_nil_non_empty_interface(t *testing.T) {

misc_tests/jsoniter_iterator_test.go

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

10-
"github.com/stretchr/testify/require"
1110
"github.com/json-iterator/go"
11+
"github.com/stretchr/testify/require"
1212
)
1313

1414
func Test_bad_case(t *testing.T) {

misc_tests/jsoniter_map_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"math/big"
66
"testing"
77

8+
"github.com/json-iterator/go"
89
"github.com/stretchr/testify/require"
910
"strings"
10-
"github.com/json-iterator/go"
1111
)
1212

1313
func Test_decode_TextMarshaler_key_map(t *testing.T) {

misc_tests/jsoniter_nested_test.go

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

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

1010
type Level1 struct {

0 commit comments

Comments
 (0)