Remove unused second part of the expiry counter

This commit is contained in:
2026-09-13 09:43:08 +02:00
parent 26186ac738
commit 94fd2aa143
4 changed files with 66 additions and 4 deletions
+8 -1
View File
@@ -123,6 +123,13 @@ func FormatDuration(d time.Duration) string {
case d%time.Hour == 0:
return fmt.Sprintf("%dh", d/time.Hour)
default:
return d.String()
// Duration.String() spells out every unit below the largest one, so a
// whole number of minutes arrives as "1m0s". Drop that tail, but only
// when the seconds really are zero: "1m30s" has to keep them.
s := d.String()
if strings.HasSuffix(s, "m0s") {
s = strings.TrimSuffix(s, "0s")
}
return s
}
}