mirror of
https://github.com/burrowers/garble.git
synced 2026-04-22 15:47:04 +08:00
update x/tools version used in go:generate
Fixes running this go:generate line with Go tip.
This commit is contained in:
+5
-3
@@ -20,6 +20,8 @@ func cmdgoQuotedisSpaceByte(c byte) bool {
|
|||||||
// allowing single or double quotes around elements.
|
// allowing single or double quotes around elements.
|
||||||
// There is no unescaping or other processing within
|
// There is no unescaping or other processing within
|
||||||
// quoted fields.
|
// quoted fields.
|
||||||
|
//
|
||||||
|
// Keep in sync with cmd/dist/quoted.go
|
||||||
func cmdgoQuotedSplit(s string) ([]string, error) {
|
func cmdgoQuotedSplit(s string) ([]string, error) {
|
||||||
// Split fields allowing '' or "" around elements.
|
// Split fields allowing '' or "" around elements.
|
||||||
// Quotes further inside the string do not count.
|
// Quotes further inside the string do not count.
|
||||||
@@ -81,16 +83,16 @@ func cmdgoQuotedJoin(args []string) (string, error) {
|
|||||||
}
|
}
|
||||||
switch {
|
switch {
|
||||||
case !sawSpace && !sawSingleQuote && !sawDoubleQuote:
|
case !sawSpace && !sawSingleQuote && !sawDoubleQuote:
|
||||||
buf = append(buf, []byte(arg)...)
|
buf = append(buf, arg...)
|
||||||
|
|
||||||
case !sawSingleQuote:
|
case !sawSingleQuote:
|
||||||
buf = append(buf, '\'')
|
buf = append(buf, '\'')
|
||||||
buf = append(buf, []byte(arg)...)
|
buf = append(buf, arg...)
|
||||||
buf = append(buf, '\'')
|
buf = append(buf, '\'')
|
||||||
|
|
||||||
case !sawDoubleQuote:
|
case !sawDoubleQuote:
|
||||||
buf = append(buf, '"')
|
buf = append(buf, '"')
|
||||||
buf = append(buf, []byte(arg)...)
|
buf = append(buf, arg...)
|
||||||
buf = append(buf, '"')
|
buf = append(buf, '"')
|
||||||
|
|
||||||
default:
|
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.
|
// 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.
|
// 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
|
//go:generate sed -i /go:generate/d cmdgo_quoted.go
|
||||||
|
|
||||||
// prefillObjectMaps collects objects which should not be obfuscated,
|
// prefillObjectMaps collects objects which should not be obfuscated,
|
||||||
|
|||||||
Reference in New Issue
Block a user