From 8dd4aee12ab78581d10d42b10aff14526ff544ce Mon Sep 17 00:00:00 2001 From: Kohei Morita Date: Sat, 13 May 2023 15:53:09 +0900 Subject: [PATCH 1/2] fix: markdown code block format Signed-off-by: Kohei Morita --- options.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 From 7d0fc2bb757e4c4f8d3f3de3cc9f4a54113bf678 Mon Sep 17 00:00:00 2001 From: Kohei Morita Date: Sat, 13 May 2023 15:57:13 +0900 Subject: [PATCH 2/2] docs: generate document Signed-off-by: Kohei Morita --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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