Skip to content

Commit

Permalink
fix go vet
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Feb 19, 2019
1 parent f606de4 commit 383baa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/retry/examples/example_quickstart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ func ExampleTryContextQuickStart() {
response, err = http.DefaultClient.Do(req)
return err
}
ctx, _ := context.WithTimeout(context.Background(), time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
br, ctx := breaker.WithContext(ctx)
defer br.Close()
defer func() {
// they do the same thing
br.Close()
cancel()
}()

if err := retry.TryContext(ctx, action, strategy.Limit(3)); err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var (
errInterrupted = errors.New("operation was interrupted")
)

func currying(action func(context.Context, uint) error, ctx context.Context) func(uint) error {
func currying(action func(context.Context, uint) error, ctx context.Context) func(uint) error { // nolint: golint
return func(attempt uint) error {
return action(ctx, attempt)
}
Expand Down

0 comments on commit 383baa1

Please sign in to comment.