1
0
mirror of https://github.com/golang/go synced 2024-11-05 22:36:10 -07:00

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 <bradfitz@golang.org>
This commit is contained in:
Dmitry Vyukov 2015-05-02 14:47:27 +03:00
parent fbb4c7454b
commit 172f27652e

View File

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