update x/tools version used in go:generate

Fixes running this go:generate line with Go tip.
pull/655/head
Daniel Martí 1 year ago
parent 0b096c9e75
commit 598d5182fb

@ -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:

@ -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,

Loading…
Cancel
Save