summaryrefslogtreecommitdiff
path: root/src/pkg/go/ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/go/ast')
-rw-r--r--src/pkg/go/ast/ast.go2
-rw-r--r--src/pkg/go/ast/walk.go4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/pkg/go/ast/ast.go b/src/pkg/go/ast/ast.go
index 2e8f0973f..abafb5663 100644
--- a/src/pkg/go/ast/ast.go
+++ b/src/pkg/go/ast/ast.go
@@ -597,7 +597,7 @@ type (
IfStmt struct {
If token.Pos // position of "if" keyword
Init Stmt // initalization statement; or nil
- Cond Expr // condition; or nil
+ Cond Expr // condition
Body *BlockStmt
Else Stmt // else branch; or nil
}
diff --git a/src/pkg/go/ast/walk.go b/src/pkg/go/ast/walk.go
index a77f8ee5e..20c337c3b 100644
--- a/src/pkg/go/ast/walk.go
+++ b/src/pkg/go/ast/walk.go
@@ -227,9 +227,7 @@ func Walk(v Visitor, node Node) {
if n.Init != nil {
Walk(v, n.Init)
}
- if n.Cond != nil {
- Walk(v, n.Cond)
- }
+ Walk(v, n.Cond)
Walk(v, n.Body)
if n.Else != nil {
Walk(v, n.Else)