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) bool

Working 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"))}
Go Reference