It seems obvious (to me) that the encoding.TextUnmarshaler interface could be implemented for time.Duration (it is implemented for time.Time, afterall).
The fact that it is not gives me pause... is there a good reason that the stdlib has not done this? What issues am I facing if I do this:
https://go.dev/play/p/nHBfS7TJQtJ
```
// UnmarshalText implements the encoding.TextUnmarshaler interface.
func (d *Duration) UnmarshalText(data []byte) error {
val, err := time.ParseDuration(string(data))
*d = Duration(val)
return err
}
```
Cheers,
Corin.