mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
cmd/toolstash: don't try comparing "compile -V=full" output
Fixes golang/go#22552. Change-Id: I2a31cf4fe85f33068502102031ed62f06abb6d6e Reviewed-on: https://go-review.googlesource.com/75670 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
9b61fcc4c5
commit
d620ba0fbb
@ -174,9 +174,16 @@ var (
|
||||
binDir string
|
||||
)
|
||||
|
||||
func canCmp(name string) bool {
|
||||
func canCmp(name string, args []string) bool {
|
||||
switch name {
|
||||
case "compile", "link", "asm":
|
||||
case "compile":
|
||||
if len(args) == 1 && (args[0] == "-V" || strings.HasPrefix(args[0], "-V=")) {
|
||||
// cmd/go uses "compile -V=full" to query the
|
||||
// compiler's build ID.
|
||||
return false
|
||||
}
|
||||
return true
|
||||
case "link", "asm":
|
||||
return true
|
||||
}
|
||||
return len(name) == 2 && '0' <= name[0] && name[0] <= '9' && (name[1] == 'a' || name[1] == 'g' || name[1] == 'l')
|
||||
@ -235,7 +242,7 @@ func main() {
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
if *cmp && canCmp(tool) {
|
||||
if *cmp && canCmp(tool, cmd[1:]) {
|
||||
compareTool()
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user