From 598d5182fbbc0bd65b3b742e4ab424786fb732f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 24 Jan 2023 16:35:11 +0000 Subject: [PATCH] update x/tools version used in go:generate Fixes running this go:generate line with Go tip. --- cmdgo_quoted.go | 8 +++++--- main.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmdgo_quoted.go b/cmdgo_quoted.go index ead4ed9..f160dcf 100644 --- a/cmdgo_quoted.go +++ b/cmdgo_quoted.go @@ -20,6 +20,8 @@ func cmdgoQuotedisSpaceByte(c byte) bool { // allowing single or double quotes around elements. // There is no unescaping or other processing within // quoted fields. +// +// Keep in sync with cmd/dist/quoted.go func cmdgoQuotedSplit(s string) ([]string, error) { // Split fields allowing '' or "" around elements. // Quotes further inside the string do not count. @@ -81,16 +83,16 @@ func cmdgoQuotedJoin(args []string) (string, error) { } switch { case !sawSpace && !sawSingleQuote && !sawDoubleQuote: - buf = append(buf, []byte(arg)...) + buf = append(buf, arg...) case !sawSingleQuote: buf = append(buf, '\'') - buf = append(buf, []byte(arg)...) + buf = append(buf, arg...) buf = append(buf, '\'') case !sawDoubleQuote: buf = append(buf, '"') - buf = append(buf, []byte(arg)...) + buf = append(buf, arg...) buf = append(buf, '"') default: diff --git a/main.go b/main.go index d524a61..c3d04e0 100644 --- a/main.go +++ b/main.go @@ -1393,7 +1393,7 @@ func (tf *transformer) findReflectFunctions(files []*ast.File) { // cmd/bundle will include a go:generate directive in its output by default. // Ours specifies a version and doesn't assume bundle is in $PATH, so drop it. -//go:generate go run golang.org/x/tools/cmd/bundle@v0.1.9 -o cmdgo_quoted.go -prefix cmdgoQuoted cmd/internal/quoted +//go:generate go run golang.org/x/tools/cmd/bundle@v0.5.0 -o cmdgo_quoted.go -prefix cmdgoQuoted cmd/internal/quoted //go:generate sed -i /go:generate/d cmdgo_quoted.go // prefillObjectMaps collects objects which should not be obfuscated,