From: Dmitry Vyukov Date: Sat, 2 May 2015 11:47:27 +0000 (+0300) Subject: go/ast: fix formatting of error message X-Git-Tag: go1.5beta1~778 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=172f27652e4e2e8c8f6f5f22cab7aa5542d38651;p=gostls13.git go/ast: fix formatting of error message 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 --- diff --git a/src/go/ast/walk.go b/src/go/ast/walk.go index d531f5e714..8ca21959b1 100644 --- a/src/go/ast/walk.go +++ b/src/go/ast/walk.go @@ -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)