diff --git a/layouts/partials/utilities/IsInvalidArgs.html b/layouts/partials/utilities/IsInvalidArgs.html index e7aa9a2..6246ad4 100644 --- a/layouts/partials/utilities/IsInvalidArgs.html +++ b/layouts/partials/utilities/IsInvalidArgs.html @@ -103,8 +103,13 @@ {{ $error = true }} {{ end }} {{ else if and (or $def.options.min $def.options.max) (in (slice "int" "float" "float64") $actual) }} - {{ if or (lt $val $def.options.min) (gt $val $def.options.max) }} - {{ warnf "[%s] argument '%s': value '%s' out of range [%d, %d]" $structure (string $key) (string $val) $def.options.min $def.options.max}} + {{ if or + (and $def.options.min (lt $val $def.options.min)) + (and $def.options.max (gt $val $def.options.max)) + }} + {{ $min := (string (or $def.options.min "-")) }} + {{ $max := (string (or $def.options.max "-")) }} + {{ warnf "[%s] argument '%s': value '%s' out of range [%s, %s]" $structure (string $key) (string $val) $min $max }} {{ $error = true }} {{ end }} {{ end }}