slice_test.go 313 B

1234567891011121314151617
  1. package test
  2. func init() {
  3. nilSlice := []string(nil)
  4. marshalCases = append(marshalCases,
  5. []interface{}{"hello"},
  6. nilSlice,
  7. &nilSlice,
  8. )
  9. unmarshalCases = append(unmarshalCases, unmarshalCase{
  10. ptr: (*[]string)(nil),
  11. input: "null",
  12. }, unmarshalCase{
  13. ptr: (*[]string)(nil),
  14. input: "[]",
  15. })
  16. }