Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: markdown code block format #93

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down