| 1 |
package test |
| 2 |
|
| 3 |
func init() { |
| 4 |
testCases = append(testCases, |
| 5 |
(*[][4]bool)(nil), |
| 6 |
(*[][4]byte)(nil), |
| 7 |
(*[][4]float64)(nil), |
| 8 |
(*[][4]int32)(nil), |
| 9 |
(*[][4]*string)(nil), |
| 10 |
(*[][4]string)(nil), |
| 11 |
(*[][4]uint8)(nil), |
| 12 |
(*[]bool)(nil), |
| 13 |
(*[]byte)(nil), |
| 14 |
(*[]float64)(nil), |
| 15 |
(*[]int32)(nil), |
| 16 |
(*[]int64)(nil), |
| 17 |
(*[]map[int32]string)(nil), |
| 18 |
(*[]map[string]string)(nil), |
| 19 |
(*[4]*[4]bool)(nil), |
| 20 |
(*[4]*[4]byte)(nil), |
| 21 |
(*[4]*[4]float64)(nil), |
| 22 |
(*[4]*[4]int32)(nil), |
| 23 |
(*[4]*[4]*string)(nil), |
| 24 |
(*[4]*[4]string)(nil), |
| 25 |
(*[4]*[4]uint8)(nil), |
| 26 |
(*[]*bool)(nil), |
| 27 |
(*[]*float64)(nil), |
| 28 |
(*[]*int32)(nil), |
| 29 |
(*[]*map[int32]string)(nil), |
| 30 |
(*[]*map[string]string)(nil), |
| 31 |
(*[]*[]bool)(nil), |
| 32 |
(*[]*[]byte)(nil), |
| 33 |
(*[]*[]float64)(nil), |
| 34 |
(*[]*[]int32)(nil), |
| 35 |
(*[]*[]*string)(nil), |
| 36 |
(*[]*[]string)(nil), |
| 37 |
(*[]*[]uint8)(nil), |
| 38 |
(*[]*string)(nil), |
| 39 |
(*[]*struct { |
| 40 |
String string |
| 41 |
Int int32 |
| 42 |
Float float64 |
| 43 |
Struct struct { |
| 44 |
X string |
| 45 |
} |
| 46 |
Slice []string |
| 47 |
Map map[string]string |
| 48 |
})(nil), |
| 49 |
(*[]*uint8)(nil), |
| 50 |
(*[][]bool)(nil), |
| 51 |
(*[][]byte)(nil), |
| 52 |
(*[][]float64)(nil), |
| 53 |
(*[][]int32)(nil), |
| 54 |
(*[][]*string)(nil), |
| 55 |
(*[][]string)(nil), |
| 56 |
(*[][]uint8)(nil), |
| 57 |
(*[]string)(nil), |
| 58 |
(*[]struct{})(nil), |
| 59 |
(*[]structEmpty)(nil), |
| 60 |
(*[]struct { |
| 61 |
F *string |
| 62 |
})(nil), |
| 63 |
(*[]struct { |
| 64 |
String string |
| 65 |
Int int32 |
| 66 |
Float float64 |
| 67 |
Struct struct { |
| 68 |
X string |
| 69 |
} |
| 70 |
Slice []string |
| 71 |
Map map[string]string |
| 72 |
})(nil), |
| 73 |
(*[]uint8)(nil), |
| 74 |
(*[]jsonMarshaler)(nil), |
| 75 |
(*[]jsonMarshalerMap)(nil), |
| 76 |
(*[]textMarshaler)(nil), |
| 77 |
(*[]textMarshalerMap)(nil), |
| 78 |
) |
| 79 |
} |
| 80 |
|
| 81 |
type jsonMarshaler struct { |
| 82 |
Id string `json:"id,omitempty" db:"id"` |
| 83 |
} |
| 84 |
|
| 85 |
func (p *jsonMarshaler) MarshalJSON() ([]byte, error) { |
| 86 |
return []byte(`{}`), nil |
| 87 |
} |
| 88 |
|
| 89 |
func (p *jsonMarshaler) UnmarshalJSON(input []byte) error { |
| 90 |
p.Id = "hello" |
| 91 |
return nil |
| 92 |
} |
| 93 |
|
| 94 |
type jsonMarshalerMap map[int]int |
| 95 |
|
| 96 |
func (p *jsonMarshalerMap) MarshalJSON() ([]byte, error) { |
| 97 |
return []byte(`{}`), nil |
| 98 |
} |
| 99 |
|
| 100 |
func (p *jsonMarshalerMap) UnmarshalJSON(input []byte) error { |
| 101 |
return nil |
| 102 |
} |
| 103 |
|
| 104 |
type textMarshaler struct { |
| 105 |
Id string `json:"id,omitempty" db:"id"` |
| 106 |
} |
| 107 |
|
| 108 |
func (p *textMarshaler) MarshalText() ([]byte, error) { |
| 109 |
return []byte(`{}`), nil |
| 110 |
} |
| 111 |
|
| 112 |
func (p *textMarshaler) UnmarshalText(input []byte) error { |
| 113 |
p.Id = "hello" |
| 114 |
return nil |
| 115 |
} |
| 116 |
|
| 117 |
type textMarshalerMap map[int]int |
| 118 |
|
| 119 |
func (p *textMarshalerMap) MarshalText() ([]byte, error) { |
| 120 |
return []byte(`{}`), nil |
| 121 |
} |
| 122 |
|
| 123 |
func (p *textMarshalerMap) UnmarshalText(input []byte) error { |
| 124 |
return nil |
| 125 |
} |