From: smasher164 Date: Thu, 27 Feb 2020 08:14:21 +0000 (-0500) Subject: cmd/compile: avoid string(int) conversion X-Git-Tag: go1.15beta1~913 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=08dee51e59413ea57d758cd8b9f330a95d7abf23;p=gostls13.git cmd/compile: avoid string(int) conversion 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 TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- diff --git a/src/cmd/compile/internal/logopt/log_opts.go b/src/cmd/compile/internal/logopt/log_opts.go index 2639d27105..49cb9cf57f 100644 --- a/src/cmd/compile/internal/logopt/log_opts.go +++ b/src/cmd/compile/internal/logopt/log_opts.go @@ -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)