func (p *Profile) Trim(node ast.Node) {
	if f, ok := node.(*ast.File); ok {
		cmap := ast.NewCommentMap(p.Fset, f, f.Comments)
		ast.Walk(&trimVisitor{p}, f)
		f.Comments = cmap.Filter(f).Comments()
	} else {
		ast.Walk(&trimVisitor{p}, node)
	}
}
Trim trims the AST rooted at node based on the coverage profile,
removing irrelevant and unreached parts of the program.
If the node is an *ast.File, comments are updated as well using
an ast.CommentMap.
package discover
import "go/ast"