]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: avoid string(int) conversion
authorsmasher164 <aindurti@gmail.com>
Thu, 27 Feb 2020 08:14:21 +0000 (03:14 -0500)
committerIan Lance Taylor <iant@golang.org>
Tue, 10 Mar 2020 00:24:30 +0000 (00:24 +0000)
Rewrite string(int) to a string literal with a NUL byte, in preparation for the vet warning.

Updates #32479.

Change-Id: If4b6879334884324df3d566b6b4166ecf501d066
Reviewed-on: https://go-review.googlesource.com/c/go/+/221338
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/logopt/log_opts.go

index 2639d271055eb8986ce985b9b633fc64815df707..49cb9cf57f3a8fc3acac02ad1731491aa6571563 100644 (file)
@@ -390,7 +390,7 @@ func FlushLoggedOpts(ctxt *obj.Link, slashPkgPath string) {
                var w io.WriteCloser
 
                if slashPkgPath == "" {
-                       slashPkgPath = string(0)
+                       slashPkgPath = "\000"
                }
                subdirpath := filepath.Join(dest, pathEscape(slashPkgPath))
                err := os.MkdirAll(subdirpath, 0755)