util.go 211 B

1234567891011121314
  1. package astutil
  2. import "go/ast"
  3. // Unparen returns e with any enclosing parentheses stripped.
  4. func Unparen(e ast.Expr) ast.Expr {
  5. for {
  6. p, ok := e.(*ast.ParenExpr)
  7. if !ok {
  8. return e
  9. }
  10. e = p.X
  11. }
  12. }