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
+9 -3
View File
@@ -169,10 +169,16 @@ func describeExpiry(t *time.Time, now time.Time) string {
if t == nil {
return "never"
}
at := t.UTC().Format("2006-01-02 15:04 MST")
d := t.Sub(now).Round(time.Minute)
if d < 0 {
switch {
case d < 0:
return "expired"
case d == 0:
// Rounded away to nothing, and a zero duration is how this program
// spells "unlimited": saying "in never" of a file about to go would
// be exactly backwards.
return at + " (in under a minute)"
}
return fmt.Sprintf("%s (in %s)", t.UTC().Format("2006-01-02 15:04 MST"),
config.FormatDuration(d))
return fmt.Sprintf("%s (in %s)", at, config.FormatDuration(d))
}