2018-02-13 23:49:40 +08:00
|
|
|
package test
|
|
|
|
|
|
|
|
func init() {
|
2018-02-14 08:39:18 +08:00
|
|
|
nilSlice := []string(nil)
|
|
|
|
marshalCases = append(marshalCases,
|
|
|
|
[]interface{}{"hello"},
|
|
|
|
nilSlice,
|
|
|
|
&nilSlice,
|
2018-02-27 12:04:11 +08:00
|
|
|
selectedMarshalCase{[]byte{1,2,3}},
|
2018-02-14 08:39:18 +08:00
|
|
|
)
|
|
|
|
unmarshalCases = append(unmarshalCases, unmarshalCase{
|
|
|
|
ptr: (*[]string)(nil),
|
|
|
|
input: "null",
|
2018-02-21 07:24:22 +08:00
|
|
|
}, unmarshalCase{
|
|
|
|
ptr: (*[]string)(nil),
|
|
|
|
input: "[]",
|
2018-02-27 12:04:11 +08:00
|
|
|
}, unmarshalCase{
|
|
|
|
ptr: (*[]byte)(nil),
|
|
|
|
input: "[1,2,3]",
|
|
|
|
}, unmarshalCase{
|
|
|
|
ptr: (*[]byte)(nil),
|
|
|
|
input: `"aGVsbG8="`,
|
|
|
|
selected: true,
|
2018-02-14 08:39:18 +08:00
|
|
|
})
|
|
|
|
}
|