Standard library / go/ast

go/ast.Filter

Predicate type used by AST declaration filters. Expected stdout: 'true false\n'.

Formal Syntax & Structure

go syntaxgo
type Filter func(string) bool

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/ast")
func main() { var f ast.Filter = ast.IsExported; fmt.Println(f("Public"), f("private")) }
Go Reference