Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 383 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 383 Bytes

Retry

package retry_test

import (
	"context"
	"errors"
	"fmt"
	"time"

	"github.com/woorui/retry"
)

func Example() {
	errfn := func(ctx context.Context) error {
		return errors.New("errString")
	}

	err := retry.Call(
		context.Background(),
		retry.FunctionFunc(errfn),
		2,
		retry.FixedRetryStrategy(time.Second),
	)

	fmt.Println(err)

	// Output:
	// errString
}