1
0
mirror of https://github.com/json-iterator/go.git synced 2025-08-07 21:52:55 +02:00
This commit is contained in:
Tao Wen
2018-02-24 22:04:41 +08:00
parent 8d6662b81b
commit fff342fd04
72 changed files with 165 additions and 176 deletions

View File

@ -60,4 +60,4 @@ func init() {
}
type structEmpty struct{}
type arrayAlis [4]stringAlias
type arrayAlis [4]stringAlias

View File

@ -1,8 +1,8 @@
package test
import (
"strings"
"encoding"
"strings"
)
func init() {
@ -26,7 +26,6 @@ func (k *stringKeyType) UnmarshalText(text []byte) error {
var _ encoding.TextMarshaler = stringKeyType("")
var _ encoding.TextUnmarshaler = new(stringKeyType)
type structKeyType struct {
X string
}
@ -41,4 +40,4 @@ func (k *structKeyType) UnmarshalText(text []byte) error {
}
var _ encoding.TextMarshaler = structKeyType{}
var _ encoding.TextUnmarshaler = &structKeyType{}
var _ encoding.TextUnmarshaler = &structKeyType{}

View File

@ -3,8 +3,8 @@ package test
import (
"bytes"
"encoding/base64"
"strings"
"encoding/json"
"strings"
)
type StringMarshaler string
@ -49,4 +49,4 @@ var _ json.Unmarshaler = new(StringMarshaler)
func init() {
testCases = append(testCases, (*StringMarshaler)(nil))
}
}

View File

@ -1,10 +1,10 @@
package test
import (
"strings"
"encoding/base64"
"bytes"
"encoding/base64"
"encoding/json"
"strings"
)
type structMarshaler struct {

View File

@ -91,7 +91,6 @@ func (p *jsonMarshaler) UnmarshalJSON(input []byte) error {
return nil
}
type jsonMarshalerMap map[int]int
func (p *jsonMarshalerMap) MarshalJSON() ([]byte, error) {
@ -117,11 +116,10 @@ func (p *textMarshaler) UnmarshalText(input []byte) error {
type textMarshalerMap map[int]int
func (p *textMarshalerMap) MarshalText() ([]byte, error) {
return []byte(`{}`), nil
}
func (p *textMarshalerMap) UnmarshalText(input []byte) error {
return nil
}
}

View File

@ -230,4 +230,4 @@ type EmbeddedPtrOption struct {
type EmbeddedPtr struct {
EmbeddedPtrOption `json:","`
}
}

View File

@ -192,12 +192,12 @@ type StringFieldNameE struct {
}
type StringFieldName struct {
F1 string `json:"F1"`
F2 string `json:"f2"`
F3 string `json:"-"`
F4 string `json:"-,"`
F5 string `json:","`
F6 string `json:""`
F1 string `json:"F1"`
F2 string `json:"f2"`
F3 string `json:"-"`
F4 string `json:"-,"`
F5 string `json:","`
F6 string `json:""`
StringFieldNameE `json:"e"`
}

View File

@ -1,10 +1,10 @@
package test
import (
"strings"
"encoding"
"bytes"
"encoding"
"encoding/base64"
"strings"
)
func init() {

View File

@ -2,9 +2,9 @@ package test
import (
"bytes"
"encoding"
"encoding/base64"
"strings"
"encoding"
)
func init() {
@ -66,4 +66,4 @@ func (m *structTextMarshaler) UnmarshalText(text []byte) error {
var _ encoding.TextMarshaler = structTextMarshaler{}
var _ encoding.TextUnmarshaler = &structTextMarshaler{}
type structTextMarshalerAlias structTextMarshaler
type structTextMarshalerAlias structTextMarshaler

View File

@ -1,15 +1,15 @@
package test
import (
"testing"
"reflect"
"fmt"
"github.com/google/gofuzz"
"strings"
"github.com/json-iterator/go"
"encoding/json"
"bytes"
"encoding/json"
"fmt"
"github.com/davecgh/go-spew/spew"
"github.com/google/gofuzz"
"github.com/json-iterator/go"
"reflect"
"strings"
"testing"
)
var testCases []interface{}