update vendor

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-11 07:10:14 +00:00
parent a18f72b565
commit ea8f47c73a
2901 changed files with 269317 additions and 43103 deletions

View File

@@ -83,7 +83,11 @@ func HumanDuration(d time.Duration) string {
} else if hours < 24*365*2 {
return fmt.Sprintf("%dd", hours/24)
} else if hours < 24*365*8 {
return fmt.Sprintf("%dy%dd", hours/24/365, (hours/24)%365)
dy := int(hours/24) % 365
if dy == 0 {
return fmt.Sprintf("%dy", hours/24/365)
}
return fmt.Sprintf("%dy%dd", hours/24/365, dy)
}
return fmt.Sprintf("%dy", int(hours/24/365))
}