blob: 7630629824af1e839b5954b72a5d5021191d69ae [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001package astutil
2
3import "go/ast"
4
5// Unparen returns e with any enclosing parentheses stripped.
6func Unparen(e ast.Expr) ast.Expr {
7 for {
8 p, ok := e.(*ast.ParenExpr)
9 if !ok {
10 return e
11 }
12 e = p.X
13 }
14}