MarshalJSON implements the json.Marshaler interface.
()
| 332 | |
| 333 | // MarshalJSON implements the json.Marshaler interface. |
| 334 | func (d Duration) MarshalJSON() ([]byte, error) { |
| 335 | return json.Marshal(d.String()) |
| 336 | } |
| 337 | |
| 338 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 339 | func (d *Duration) UnmarshalJSON(bytes []byte) error { |