From ef6e53bb5f521e4d400849b79bc72e89fe2a7484 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 11 May 2020 18:41:11 -0400 Subject: core: Add support for `d` duration unit (#3323) * caddy: Add support for `d` duration unit * Improvements to ParseDuration; add unit tests Co-authored-by: Matthew Holt --- caddyconfig/httpcaddyfile/options.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'caddyconfig') diff --git a/caddyconfig/httpcaddyfile/options.go b/caddyconfig/httpcaddyfile/options.go index de288db..49a11f6 100644 --- a/caddyconfig/httpcaddyfile/options.go +++ b/caddyconfig/httpcaddyfile/options.go @@ -16,7 +16,6 @@ package httpcaddyfile import ( "strconv" - "time" "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" @@ -227,7 +226,7 @@ func parseOptOnDemand(d *caddyfile.Dispenser) (interface{}, error) { if !d.NextArg() { return nil, d.ArgErr() } - dur, err := time.ParseDuration(d.Val()) + dur, err := caddy.ParseDuration(d.Val()) if err != nil { return nil, err } -- cgit v1.2.3