MarshalJSON implements the json.Marshaler interface.
()
| 291 | |
| 292 | // MarshalJSON implements the json.Marshaler interface. |
| 293 | func (d Duration) MarshalJSON() ([]byte, error) { |
| 294 | return json.Marshal(d.String()) |
| 295 | } |
| 296 | |
| 297 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 298 | func (d *Duration) UnmarshalJSON(bytes []byte) error { |