]> Cypherpunks repositories - gostls13.git/commitdiff
go/ast: fix formatting of error message
authorDmitry Vyukov <dvyukov@google.com>
Sat, 2 May 2015 11:47:27 +0000 (14:47 +0300)
committerDmitry Vyukov <dvyukov@google.com>
Sat, 2 May 2015 14:54:32 +0000 (14:54 +0000)
There are three problems:
1. There is no CR at the end of the message.
2. The message is unconditionally printed.
3. The message is printed to stdout.

Change-Id: Ib2d880eea03348e8a69720aad7752302a75bd277
Reviewed-on: https://go-review.googlesource.com/9622
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/go/ast/walk.go

index d531f5e7144322b4a494b9952b1b456b71e83460..8ca21959b11a012cae79c9f018100cb3bf1fe7fc 100644 (file)
@@ -361,8 +361,7 @@ func Walk(v Visitor, node Node) {
                }
 
        default:
-               fmt.Printf("ast.Walk: unexpected node type %T", n)
-               panic("ast.Walk")
+               panic(fmt.Sprintf("ast.Walk: unexpected node type %T", n))
        }
 
        v.Visit(nil)