Imports #
_ "embed"
"go/ast"
"go/token"
"log"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
"golang.org/x/tools/go/ast/inspector"
_ "embed"
"go/ast"
"go/token"
"log"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
"golang.org/x/tools/go/ast/inspector"
var Analyzer = *ast.UnaryExpr
go:embed doc.go
var doc string
type deadState struct {
pass *analysis.Pass
hasBreak map[ast.Stmt]bool
hasGoto map[string]bool
labels map[string]ast.Stmt
breakTarget ast.Stmt
reachable bool
}
findDead walks the statement looking for dead code. If d.reachable is false on entry, stmt itself is dead. When findDead returns, d.reachable tells whether the statement following stmt is reachable.
func (d *deadState) findDead(stmt ast.Stmt)
findLabels gathers information about the labels defined and used by stmt and about which statements break, whether a label is involved or not.
func (d *deadState) findLabels(stmt ast.Stmt)
func run(pass *analysis.Pass) (interface{}, error)
Generated with Arrow