From e2ea89977603cab2456a0586c4f755917294f43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20Alt=C4=B1?= Date: Wed, 18 Dec 2024 09:02:03 +0300 Subject: [PATCH] fix retry example --- example_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/example_test.go b/example_test.go index 346c54c..d6ae24f 100644 --- a/example_test.go +++ b/example_test.go @@ -2,13 +2,14 @@ package backoff import ( "context" + "fmt" "log" ) func ExampleRetry() { // An operation that may fail. - operation := func() (bool, error) { - return true, nil + operation := func() (string, error) { + return "hello", nil } _, err := Retry(context.TODO(), operation, WithBackOff(NewExponentialBackOff())) @@ -18,6 +19,9 @@ func ExampleRetry() { } // Operation is successful. + + fmt.Println("hello") + // Output: hello } func ExampleTicker() {