From 08dee51e59413ea57d758cd8b9f330a95d7abf23 Mon Sep 17 00:00:00 2001 From: smasher164 Date: Thu, 27 Feb 2020 03:14:21 -0500 Subject: [PATCH] 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 --- src/cmd/compile/internal/logopt/log_opts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.50.0