| 1 |
package test |
| 2 |
|
| 3 |
func init() { |
| 4 |
nilSlice := []string(nil) |
| 5 |
marshalCases = append(marshalCases, |
| 6 |
[]interface{}{"hello"}, |
| 7 |
nilSlice, |
| 8 |
&nilSlice, |
| 9 |
[]byte{1, 2, 3}, |
| 10 |
) |
| 11 |
unmarshalCases = append(unmarshalCases, unmarshalCase{ |
| 12 |
ptr: (*[]string)(nil), |
| 13 |
input: "null", |
| 14 |
}, unmarshalCase{ |
| 15 |
ptr: (*[]string)(nil), |
| 16 |
input: "[]", |
| 17 |
}, unmarshalCase{ |
| 18 |
ptr: (*[]byte)(nil), |
| 19 |
input: "[1,2,3]", |
| 20 |
}, unmarshalCase{ |
| 21 |
ptr: (*[]byte)(nil), |
| 22 |
input: `"aGVsbG8="`, |
| 23 |
}, unmarshalCase{ |
| 24 |
ptr: (*[]byte)(nil), |
| 25 |
input: `"c3ViamVjdHM\/X2Q9MQ=="`, |
| 26 |
}) |
| 27 |
} |