diff --git a/README.md b/README.md index dcda9a1..8aaf17d 100644 --- a/README.md +++ b/README.md @@ -355,19 +355,17 @@ wait for a set duration for retries. example of augmenting time.After with a print statement -type struct MyTimer {} + type struct MyTimer {} func (t *MyTimer) After(d time.Duration) <- chan time.Time { fmt.Print("Timer called!") return time.After(d) } -retry.Do( - + retry.Do( func() error { ... }, retry.WithTimer(&MyTimer{}) - -) + ) #### type RetryIfFunc diff --git a/options.go b/options.go index ea9687f..cff566e 100644 --- a/options.go +++ b/options.go @@ -232,19 +232,17 @@ func Context(ctx context.Context) Option { // // example of augmenting time.After with a print statement // -// type struct MyTimer {} +// type struct MyTimer {} // // func (t *MyTimer) After(d time.Duration) <- chan time.Time { // fmt.Print("Timer called!") // return time.After(d) // } // -// retry.Do( -// +// retry.Do( // func() error { ... }, // retry.WithTimer(&MyTimer{}) -// -// ) +// ) func WithTimer(t Timer) Option { return func(c *Config) { c.timer = t