From 06765c9ef5bece82ca33cd167a9f99cd78533fa8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 23 Jun 2023 13:06:03 +0200 Subject: [PATCH] oci: replace some fmt.Sprintfs with strconv Teeny-tiny optimizations: BenchmarkSprintf-10 37735996 32.31 ns/op 0 B/op 0 allocs/op BenchmarkItoa-10 591945836 2.031 ns/op 0 B/op 0 allocs/op BenchmarkFormatUint-10 593701444 2.014 ns/op 0 B/op 0 allocs/op Signed-off-by: Sebastiaan van Stijn --- oci/spec_opts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oci/spec_opts.go b/oci/spec_opts.go index 359a1af23..55ccaf09a 100644 --- a/oci/spec_opts.go +++ b/oci/spec_opts.go @@ -420,7 +420,7 @@ func WithImageConfigArgs(image Image, args []string) SpecOpts { if err := WithUser(config.User)(ctx, client, c, s); err != nil { return err } - return WithAdditionalGIDs(fmt.Sprintf("%d", s.Process.User.UID))(ctx, client, c, s) + return WithAdditionalGIDs(strconv.FormatInt(int64(s.Process.User.UID), 10))(ctx, client, c, s) } // we should query the image's /etc/group for additional GIDs // even if there is no specified user in the image config