MarshalJSON - converts to JSON data.
()
| 115 | |
| 116 | // MarshalJSON - converts to JSON data. |
| 117 | func (set StringSet) MarshalJSON() ([]byte, error) { |
| 118 | return json.Marshal(set.ToSlice()) |
| 119 | } |
| 120 | |
| 121 | // UnmarshalJSON - parses JSON data and creates new set with it. |
| 122 | func (set *StringSet) UnmarshalJSON(data []byte) error { |