Allow parse_duration
function to parse multiple duration similar to Golang's time.ParseDuration
#1196
Labels
type: feature
A value-adding code addition that introduce new functionality.
vrl: stdlib
Changes to the standard library
Hi, I would like to add the feature for VRL, which is allow
parse_duration
function to parse give string with multiple units such as1h1s
, and3s3ms
and so on similar to golang's time.ParseDuration.Basically, golang's implementation parse given string until finding the duration unit, and keeps finding next digit unit match next duration unit. So, space is not allowed in the given duration string in golang. But since space is already allowed in VRL's
parse_duraiton
. I think space could be added for multiple-units duration string.However, golang's implementation allows sign for given duration string. Whether we should add the support for signed duration deserves another issue opened.
The text was updated successfully, but these errors were encountered: