MarshalJSON implements json.Marshaler.
()
| 33 | |
| 34 | // MarshalJSON implements json.Marshaler. |
| 35 | func (v SampleValue) MarshalJSON() ([]byte, error) { |
| 36 | return json.Marshal(v.String()) |
| 37 | } |
| 38 | |
| 39 | // UnmarshalJSON implements json.Unmarshaler. |
| 40 | func (v *SampleValue) UnmarshalJSON(b []byte) error { |