MarshalJSON - converts to JSON data.
()
| 90 | |
| 91 | // MarshalJSON - converts to JSON data. |
| 92 | func (set IntSet) MarshalJSON() ([]byte, error) { |
| 93 | return json.Marshal(set.ToSlice()) |
| 94 | } |
| 95 | |
| 96 | // UnmarshalJSON - parses JSON data and creates new set with it. |
| 97 | func (set *IntSet) UnmarshalJSON(data []byte) error { |