Skip to content

Commit

Permalink
use strconv.FormatUint instead of fmt.Sprintf (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-berenda committed Jul 18, 2022
1 parent 7fdae0e commit 854bd94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package grpc_retry

import (
"context"
"fmt"
"io"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -293,7 +293,7 @@ func perCallContext(parentCtx context.Context, callOpts *options, attempt uint)
ctx, _ = context.WithTimeout(ctx, callOpts.perCallTimeout)
}
if attempt > 0 && callOpts.includeHeader {
mdClone := metautils.ExtractOutgoing(ctx).Clone().Set(AttemptMetadataKey, fmt.Sprintf("%d", attempt))
mdClone := metautils.ExtractOutgoing(ctx).Clone().Set(AttemptMetadataKey, strconv.FormatUint(uint64(attempt), 10))
ctx = mdClone.ToOutgoing(ctx)
}
return ctx
Expand Down

0 comments on commit 854bd94

Please sign in to comment.