Skip to content

Commit 854bd94

Browse files
use strconv.FormatUint instead of fmt.Sprintf (grpc-ecosystem#503)
1 parent 7fdae0e commit 854bd94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

retry/retry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ package grpc_retry
55

66
import (
77
"context"
8-
"fmt"
98
"io"
9+
"strconv"
1010
"sync"
1111
"time"
1212

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

0 commit comments

Comments
 (0)