mirror of
https://github.com/burrowers/garble.git
synced 2025-09-26 20:01:16 +08:00
update x/tools version used in go:generate
Fixes running this go:generate line with Go tip.
This commit is contained in:
@@ -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:
|
||||
|
2
main.go
2
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,
|
||||
|
Reference in New Issue
Block a user