From a9254b7977ae6e604db3b0790a00a5e8fe16626c Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sun, 3 Mar 2024 11:49:55 +0100 Subject: [PATCH] remove reserved word --- internal/piwigo/piwigotools/time_result.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/piwigo/piwigotools/time_result.go b/internal/piwigo/piwigotools/time_result.go index fc9c1b7..bccbd6e 100644 --- a/internal/piwigo/piwigotools/time_result.go +++ b/internal/piwigo/piwigotools/time_result.go @@ -45,7 +45,7 @@ func (c TimeResult) toTime() time.Time { } func (c TimeResult) AgeAt(createdAt *TimeResult) string { - var year, month, day, hour, min, sec int + var year, month, day, hour, minutes, seconds int a := c.toTime() if a.IsZero() { return "" @@ -67,20 +67,20 @@ func (c TimeResult) AgeAt(createdAt *TimeResult) string { h1, m1, s1 := a.Clock() h2, m2, s2 := b.Clock() - year = int(y2 - y1) + year = y2 - y1 month = int(M2 - M1) - day = int(d2 - d1) - hour = int(h2 - h1) - min = int(m2 - m1) - sec = int(s2 - s1) + day = d2 - d1 + hour = h2 - h1 + minutes = m2 - m1 + seconds = s2 - s1 // Normalize negative values - if sec < 0 { - sec += 60 - min-- + if seconds < 0 { + seconds += 60 + minutes-- } - if min < 0 { - min += 60 + if minutes < 0 { + minutes += 60 hour-- } if hour < 0 {