aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/coverage
diff options
context:
space:
mode:
authorPhilippe Antoine <contact@catenacyber.fr>2023-03-23 08:14:39 +0000
committerGopher Robot <gobot@golang.org>2023-03-31 18:41:24 +0000
commit092d43c329babb41f9bbad265bfe82bb48522b64 (patch)
treea1eeb7c62a6ed5ab190e69ee0c4feb0be5818214 /src/runtime/coverage
parente539461e34b1c5163220f9910b2c0360fb9f21e4 (diff)
downloadgo-092d43c329babb41f9bbad265bfe82bb48522b64.tar.xz
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 <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/runtime/coverage')
-rw-r--r--src/runtime/coverage/emit.go5
1 files changed, 3 insertions, 2 deletions
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
}