aboutsummaryrefslogtreecommitdiff
path: root/strava/strava.go
diff options
context:
space:
mode:
Diffstat (limited to 'strava/strava.go')
-rw-r--r--strava/strava.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/strava/strava.go b/strava/strava.go
index 309d0ee..a619e0a 100644
--- a/strava/strava.go
+++ b/strava/strava.go
@@ -150,10 +150,7 @@ type RateLimitError struct {
func (e *RateLimitError) Error() string {
if !e.RetryAfter.IsZero() {
- until := time.Until(e.RetryAfter).Truncate(time.Second)
- if until < 0 {
- until = 0
- }
+ until := max(time.Until(e.RetryAfter).Truncate(time.Second), 0)
scope := "15-minute"
if e.IsDaily {
scope = "daily"