Standard library / go/doc
go/doc.Filter
Function type used to keep selected documentation names. Expected stdout: 'true false\n'.
Formal Syntax & Structure
go syntaxgo
type Filter func(string) boolWorking Example
Example Snippetgo
package main
import ( "fmt" "go/doc")
func main() { var f doc.Filter = func(s string) bool { return s == "Answer" } fmt.Println(f("Answer"), f("Work"))}