MCPcopy
hub / github.com/PuerkitoBio/goquery / FilterFunction

Method FilterFunction

filter.go:32–34  ·  view source on GitHub ↗

FilterFunction reduces the set of matched elements to those that pass the function's test. It returns a new Selection object for this subset of elements.

(f func(int, *Selection) bool)

Source from the content-addressed store, hash-verified

30// FilterFunction reduces the set of matched elements to those that pass the function's test.
31// It returns a new Selection object for this subset of elements.
32func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection {
33 return pushStack(s, winnowFunction(s, f, true))
34}
35
36// NotFunction removes elements from the Selection that pass the function's test.
37// It returns a new Selection object with the matching elements removed.

Callers 5

HasNodesMethod · 0.95
IsFunctionMethod · 0.95
BenchmarkFilterFunctionFunction · 0.80
TestFilterFunctionFunction · 0.80

Calls 2

pushStackFunction · 0.85
winnowFunctionFunction · 0.85

Tested by 3

BenchmarkFilterFunctionFunction · 0.64
TestFilterFunctionFunction · 0.64