hashicorp / go-secure-stdlib

Mozilla Public License 2.0
64 stars 24 forks source link

Add day suffix support to ParseDurationSecond #13

Closed kalafut closed 2 years ago

kalafut commented 3 years ago

Add support for a "d" suffix that corresponds to 24 hours. Also add more test cases and slightly refactor the code.

This type of support has been requested and rejected by the Go team (https://github.com/golang/go/issues/11473). Their push back was around "how long is a day?", but for our users I think defining a day as 24 hours is fine, and convenient for longer duration TTLs, e.g. root keys that are valid for 90 days.