Skip to content

Commit

Permalink
Merge pull request #93 from mrtc0/master
Browse files Browse the repository at this point in the history
fix: markdown code block format
  • Loading branch information
JaSei committed Aug 3, 2023
2 parents c6b67a0 + 7d0fc2b commit 72ba19c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
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

0 comments on commit 72ba19c

Please sign in to comment.