You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-08-07 21:52:55 +02:00
check nil for interface{}
This commit is contained in:
@ -251,8 +251,8 @@ func init() {
|
||||
})(nil),
|
||||
(*struct {
|
||||
TF1 struct {
|
||||
F1 withTime
|
||||
F2 *withTime
|
||||
F2 int
|
||||
F1 *withTime
|
||||
}
|
||||
})(nil),
|
||||
(*DeeplyNested)(nil),
|
||||
|
@ -15,7 +15,18 @@ import (
|
||||
var testCases []interface{}
|
||||
var asymmetricTestCases [][2]interface{}
|
||||
|
||||
type selectedSymmetricCase struct {
|
||||
testCase interface{}
|
||||
}
|
||||
|
||||
func Test_symmetric(t *testing.T) {
|
||||
for _, testCase := range testCases {
|
||||
selectedSymmetricCase, found := testCase.(selectedSymmetricCase)
|
||||
if found {
|
||||
testCases = []interface{}{selectedSymmetricCase.testCase}
|
||||
break
|
||||
}
|
||||
}
|
||||
for _, testCase := range testCases {
|
||||
valType := reflect.TypeOf(testCase).Elem()
|
||||
t.Run(valType.String(), func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user