_linters/src/honnef.co/go/tools/unused/unused.go
func (c *Checker) processCgoExported(pkg *lint.Pkg, node ast.Node) {
	if node, ok := node.(*ast.FuncDecl); ok {
		if node.Doc == nil {
			return
		}
		for _, cmt := range node.Doc.List {
			if !strings.HasPrefix(cmt.Text, "//go:cgo_export_") {
				return
			}
			obj := pkg.TypesInfo.ObjectOf(node.Name)
			c.graph.roots = append(c.graph.roots, c.graph.getNode(obj))
		}
	}
}
func (c *Checker) processCgoExported(pkg *lint.Pkg, node ast.Node) {
	if node, ok := node.(*ast.FuncDecl); ok {
		if node.Doc == nil {
			return
		}
		for _, cmt := range node.Doc.List {
			if !strings.HasPrefix(cmt.Text, "//go:cgo_export_") {
				return
			}
			obj := pkg.TypesInfo.ObjectOf(node.Name)
			c.graph.roots = append(c.graph.roots, c.graph.getNode(obj))
		}
	}
}
func ( c * Checker ) processCgoExported ( pkg * lint . Pkg , node ast . Node ) { if node , ok := node . ( * ast . FuncDecl ) ; ok { if node . Doc == nil { return } for _ , cmt := range node . Doc . List { if ! strings . HasPrefix ( cmt . Text , " " ) { return } obj := pkg . TypesInfo . ObjectOf ( node . Name ) c . graph . roots = append ( c . graph . roots , c . graph . getNode ( obj ) ) } } }
// processCgoExported marks functions as used if they're being
// exported to cgo.
processCgoExported marks functions as used if they re being exported to cgo .