mirror of
https://github.com/rancher/rke.git
synced 2025-09-25 06:33:56 +00:00
update to k8s v1.21 and go 1.16
This commit is contained in:
13
vendor/github.com/Masterminds/sprig/v3/date.go
generated
vendored
13
vendor/github.com/Masterminds/sprig/v3/date.go
generated
vendored
@@ -81,6 +81,19 @@ func dateAgo(date interface{}) string {
|
||||
return duration.String()
|
||||
}
|
||||
|
||||
func duration(sec interface{}) string {
|
||||
var n int64
|
||||
switch value := sec.(type) {
|
||||
default:
|
||||
n = 0
|
||||
case string:
|
||||
n, _ = strconv.ParseInt(value, 10, 64)
|
||||
case int64:
|
||||
n = value
|
||||
}
|
||||
return (time.Duration(n) * time.Second).String()
|
||||
}
|
||||
|
||||
func durationRound(duration interface{}) string {
|
||||
var d time.Duration
|
||||
switch duration := duration.(type) {
|
||||
|
Reference in New Issue
Block a user