mirror of
https://github.com/caddyserver/caddy.git
synced 2026-09-01 00:48:03 +00:00
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 <mholt@users.noreply.github.com>
This commit is contained in:
parent
35e1d92d58
commit
ef6e53bb5f
7 changed files with 167 additions and 18 deletions
|
|
@ -311,7 +311,7 @@ func (f Flags) Float64(name string) float64 {
|
|||
// is not a duration type. It panics if the flag is
|
||||
// not in the flag set.
|
||||
func (f Flags) Duration(name string) time.Duration {
|
||||
val, _ := time.ParseDuration(f.String(name))
|
||||
val, _ := caddy.ParseDuration(f.String(name))
|
||||
return val
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue