You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-24 23:16:47 +02:00
gofmt
This commit is contained in:
@ -57,7 +57,7 @@ func (encoder *arrayEncoder) EncodeInterface(val interface{}, stream *Stream) {
|
||||
return
|
||||
}
|
||||
elemType := encoder.arrayType.Elem()
|
||||
if encoder.arrayType.Len() == 1 && (elemType.Kind() == reflect.Ptr ||elemType.Kind() == reflect.Map) {
|
||||
if encoder.arrayType.Len() == 1 && (elemType.Kind() == reflect.Ptr || elemType.Kind() == reflect.Map) {
|
||||
ptr := uintptr(e.word)
|
||||
e.word = unsafe.Pointer(&ptr)
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package jsoniter
|
||||
|
||||
import (
|
||||
"encoding"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"unsafe"
|
||||
"reflect"
|
||||
"encoding"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type stringCodec struct {
|
||||
@ -419,7 +419,7 @@ func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
||||
}
|
||||
encoding := base64.StdEncoding
|
||||
src := iter.SkipAndReturnBytes()
|
||||
src = src[1: len(src)-1]
|
||||
src = src[1 : len(src)-1]
|
||||
decodedLen := encoding.DecodedLen(len(src))
|
||||
dst := make([]byte, decodedLen)
|
||||
len, err := encoding.Decode(dst, src)
|
||||
|
@ -3,10 +3,10 @@ package jsoniter
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/json-iterator/go/require"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func Test_new_decoder(t *testing.T) {
|
||||
@ -73,7 +73,7 @@ func Test_use_number_for_unmarshal(t *testing.T) {
|
||||
func Test_marshal_indent(t *testing.T) {
|
||||
t.Skip("WIP")
|
||||
should := require.New(t)
|
||||
output, err := json.MarshalIndent(struct{
|
||||
output, err := json.MarshalIndent(struct {
|
||||
F1 int
|
||||
F2 []int
|
||||
}{1, []int{2, 3, 4}}, "", " ")
|
||||
|
Reference in New Issue
Block a user