Duration wraps time.Duration and provides better JSON marshaling and unmarshalling. The default time.Duration marshals as an integer and only accepts integers when unmarshalling, which is not very user friendly as users cannot write durations like "1h30m". This type marshals as a string like "1h30m
| 15 | // This type marshals as a string like "1h30m", and unmarshals from either a |
| 16 | // string or an integer. |
| 17 | type Duration time.Duration |
| 18 | |
| 19 | var ( |
| 20 | _ json.Marshaler = Duration(0) |
no outgoing calls
no test coverage detected