clean some redundant else clauses
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
parent
172a4e1f5a
commit
b085b4b5a7
1 changed files with 1 additions and 2 deletions
|
@ -26,7 +26,6 @@ func HumanDuration(d time.Duration) string {
|
|||
return fmt.Sprintf("%d weeks", hours/24/7)
|
||||
} else if hours < 24*365*2 {
|
||||
return fmt.Sprintf("%d months", hours/24/30)
|
||||
} else {
|
||||
return fmt.Sprintf("%d years", hours/24/365)
|
||||
}
|
||||
return fmt.Sprintf("%d years", int(d.Hours())/24/365)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue