From 092d43c329babb41f9bbad265bfe82bb48522b64 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 23 Mar 2023 08:14:39 +0000 Subject: all: replace fmt.Sprintf("%d") with strconv.Itoa This was found by running `git grep 'fmt.Sprintf("%d",' | grep -v test | grep -v vendor` And this was automatically fixed with gotiti https://github.com/catenacyber/gotiti and using unconvert https://github.com/mdempsky/unconvert to check if there was (tool which fixed another useless cast) Change-Id: I023926bc4aa8d51de45f712ac739a0a80145c28c GitHub-Last-Rev: 1063e32e5b69b6f9bb17673887b8c4ebe5be8fe4 GitHub-Pull-Request: golang/go#59144 Reviewed-on: https://go-review.googlesource.com/c/go/+/477675 Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/runtime/coverage/emit.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/runtime/coverage') diff --git a/src/runtime/coverage/emit.go b/src/runtime/coverage/emit.go index 300ff2caca..0f77ce287b 100644 --- a/src/runtime/coverage/emit.go +++ b/src/runtime/coverage/emit.go @@ -16,6 +16,7 @@ import ( "path/filepath" "reflect" "runtime" + "strconv" "sync/atomic" "time" "unsafe" @@ -357,7 +358,7 @@ func (s *emitState) openMetaFile(metaHash [16]byte, metaLen uint64) error { fi, err := os.Stat(s.mfname) if err != nil || fi.Size() != int64(metaLen) { // We need a new meta-file. - tname := "tmp." + fn + fmt.Sprintf("%d", time.Now().UnixNano()) + tname := "tmp." + fn + strconv.FormatInt(time.Now().UnixNano(), 10) s.mftmp = filepath.Join(s.outdir, tname) s.mf, err = os.Create(s.mftmp) if err != nil { @@ -613,7 +614,7 @@ func (s *emitState) VisitFuncs(f encodecounter.CounterVisitorFn) error { // is also used to capture GOOS + GOARCH values as well. func captureOsArgs() map[string]string { m := make(map[string]string) - m["argc"] = fmt.Sprintf("%d", len(os.Args)) + m["argc"] = strconv.Itoa(len(os.Args)) for k, a := range os.Args { m[fmt.Sprintf("argv%d", k)] = a } -- cgit v1.3