ptr_test.go 474 B

12345678910111213141516171819202122232425
  1. package test
  2. func init() {
  3. var pEFace = func(val interface{}) *interface{} {
  4. return &val
  5. }
  6. var pInt = func(val int) *int {
  7. return &val
  8. }
  9. unmarshalCases = append(unmarshalCases, unmarshalCase{
  10. ptr: (**interface{})(nil),
  11. input: `"hello"`,
  12. }, unmarshalCase{
  13. ptr: (**interface{})(nil),
  14. input: `1e1`,
  15. }, unmarshalCase{
  16. ptr: (**interface{})(nil),
  17. input: `1.0e1`,
  18. })
  19. marshalCases = append(marshalCases,
  20. pEFace("hello"),
  21. (*int)(nil),
  22. pInt(100),
  23. )
  24. }