Change-Id: Ie7dce45d554fde69d682680f55abba6a7fc55036
Reviewed-on: https://go-review.googlesource.com/c/142017
Reviewed-by: Ian Lance Taylor <iant@golang.org>
found := false
f.walk(x, ctxExpr,
func(f *File, x interface{}, context astContext) {
- switch x.(type) {
- case *ast.CallExpr:
+ if _, ok := x.(*ast.CallExpr); ok {
found = true
}
})
// in case expression being replaced is first on line.
// See golang.org/issue/6563.
pos := (*r.Expr).Pos()
- switch x := expr.(type) {
- case *ast.Ident:
+ if x, ok := expr.(*ast.Ident); ok {
expr = &ast.Ident{NamePos: pos, Name: x.Name}
}