Skip to content

Commit 4a1a233

Browse files
authored
docs: add the missing package reference to examples and playgrounds (samber#278)
* docs: add the missing package reference to examples and playgrounds
1 parent 4c57f6b commit 4a1a233

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ Invokes a function N times until it returns valid output. Returning either the c
23442344
When first argument is less than `1`, the function runs until a successful response is returned.
23452345

23462346
```go
2347-
count1, err1 := AttemptWhile(5, func(i int) (error, bool) {
2347+
count1, err1 := lo.AttemptWhile(5, func(i int) (error, bool) {
23482348
err := doMockedHTTPRequest(i)
23492349
if err != nil {
23502350
if errors.Is(err, ErrBadRequest) { // lets assume ErrBadRequest is a critical error that needs to terminate the invoke
@@ -2360,7 +2360,7 @@ count1, err1 := AttemptWhile(5, func(i int) (error, bool) {
23602360

23612361
For more advanced retry strategies (delay, exponential backoff...), please take a look on [cenkalti/backoff](https://github.com/cenkalti/backoff).
23622362

2363-
[play](https://go.dev/play/p/M2wVq24PaZM)
2363+
[[play](https://go.dev/play/p/M2wVq24PaZM)]
23642364

23652365
### AttemptWhileWithDelay
23662366

@@ -2369,7 +2369,7 @@ Invokes a function N times until it returns valid output, with a pause between e
23692369
When first argument is less than `1`, the function runs until a successful response is returned.
23702370

23712371
```go
2372-
count1, time1, err1 := AttemptWhileWithDelay(5, time.Millisecond, func(i int, d time.Duration) (error, bool) {
2372+
count1, time1, err1 := lo.AttemptWhileWithDelay(5, time.Millisecond, func(i int, d time.Duration) (error, bool) {
23732373
err := doMockedHTTPRequest(i)
23742374
if err != nil {
23752375
if errors.Is(err, ErrBadRequest) { // lets assume ErrBadRequest is a critical error that needs to terminate the invoke
@@ -2385,7 +2385,7 @@ count1, time1, err1 := AttemptWhileWithDelay(5, time.Millisecond, func(i int, d
23852385

23862386
For more advanced retry strategies (delay, exponential backoff...), please take a look on [cenkalti/backoff](https://github.com/cenkalti/backoff).
23872387

2388-
[play](https://go.dev/play/p/LPsWgf1ilBO)
2388+
[[play](https://go.dev/play/p/cfcmhvLO-nv)]
23892389

23902390
### Debounce
23912391

0 commit comments

Comments
 (0)