GoPLS Viewer

Home|gopls/go/ast/astutil/util.go
1// Copyright 2015 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package astutil
6
7import "go/ast"
8
9// Unparen returns e with any enclosing parentheses stripped.
10func Unparen(e ast.Exprast.Expr {
11    for {
12        pok := e.(*ast.ParenExpr)
13        if !ok {
14            return e
15        }
16        e = p.X
17    }
18}
19
MembersX
Unparen
Unparen.e
Members
X