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-03-15 21:28:16 +08:00
|
|
|
[]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="`,
|
2018-05-26 09:38:52 +08:00
|
|
|
}, unmarshalCase{
|
|
|
|
ptr: (*[]byte)(nil),
|
|
|
|
input: `"c3ViamVjdHM\/X2Q9MQ=="`,
|
2018-02-14 08:39:18 +08:00
|
|
|
})
|
|
|
|
}
|