You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-12-17 23:27:37 +02:00
#152 gofmt
This commit is contained in:
@@ -17,7 +17,7 @@ type Config struct {
|
|||||||
EscapeHTML bool
|
EscapeHTML bool
|
||||||
SortMapKeys bool
|
SortMapKeys bool
|
||||||
UseNumber bool
|
UseNumber bool
|
||||||
TagKey string
|
TagKey string
|
||||||
}
|
}
|
||||||
|
|
||||||
type frozenConfig struct {
|
type frozenConfig struct {
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ func CastJsonNumber(val interface{}) (string, bool) {
|
|||||||
return string(typedVal), true
|
return string(typedVal), true
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"reflect"
|
"reflect"
|
||||||
"unsafe"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func encoderOfStruct(cfg *frozenConfig, typ reflect.Type) (ValEncoder, error) {
|
func encoderOfStruct(cfg *frozenConfig, typ reflect.Type) (ValEncoder, error) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"reflect"
|
"reflect"
|
||||||
"unsafe"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder) (ValDecoder, error) {
|
func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder) (ValDecoder, error) {
|
||||||
|
|||||||
@@ -313,4 +313,4 @@ func Test_recursive_empty_interface_customization(t *testing.T) {
|
|||||||
should := require.New(t)
|
should := require.New(t)
|
||||||
Unmarshal([]byte("[100]"), &obj)
|
Unmarshal([]byte("[100]"), &obj)
|
||||||
should.Equal([]interface{}{int64(100)}, obj)
|
should.Equal([]interface{}{int64(100)}, obj)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func Test_chan(t *testing.T) {
|
|||||||
t.Skip("do not support chan")
|
t.Skip("do not support chan")
|
||||||
|
|
||||||
type TestObject struct {
|
type TestObject struct {
|
||||||
MyChan chan bool
|
MyChan chan bool
|
||||||
MyField int
|
MyField int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,4 +112,4 @@ func Test_chan(t *testing.T) {
|
|||||||
str, err := json.Marshal(obj)
|
str, err := json.Marshal(obj)
|
||||||
should.Nil(err)
|
should.Nil(err)
|
||||||
should.Equal(``, str)
|
should.Equal(``, str)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package jsoniter
|
package jsoniter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_decode_one_field_struct(t *testing.T) {
|
func Test_decode_one_field_struct(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user