From 717ca8e1666c33a963a285fd22bb6cd6c514a547 Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Mon, 13 Feb 2023 12:55:04 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Abhinav Gupta --- options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index a5f4a60..44c616d 100644 --- a/options.go +++ b/options.go @@ -63,7 +63,7 @@ func (o *opts) validate() error { if o.maxRetries < 0 { return errors.New("maxRetryAttempts should be greater than 0") } - if o.maxSleep < time.Duration(0) { + if o.maxSleep <= 0 { return errors.New("maxSleepInterval should be greater than 0s") } return nil @@ -108,7 +108,7 @@ func IgnoreCurrent() Option { } // MaxSleepInterval sets the maximum sleep time in-between each retry attempt. -// The sleep duration is growing in an exponential backoff but limits to the value we set. +// The sleep duration grows in an exponential backoff, to a maximum of the value specified here. // If not configured, default to 100 microseconds. func MaxSleepInterval(d time.Duration) Option { return optionFunc(func(opts *opts) {