MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / IndexOfSelection

Method IndexOfSelection

array.go:125–130  ·  view source on GitHub ↗

IndexOfSelection returns the position of the first node in the specified Selection object within this Selection object, or -1 if not found.

(sel *Selection)

Source from the content-addressed store, hash-verified

123// IndexOfSelection returns the position of the first node in the specified
124// Selection object within this Selection object, or -1 if not found.
125func (s *Selection) IndexOfSelection(sel *Selection) int {
126 if sel != nil && len(sel.Nodes) > 0 {
127 return indexInSlice(s.Nodes, sel.Nodes[0])
128 }
129 return -1
130}

Callers 2

TestIndexOfSelectionFunction · 0.80

Calls 1

indexInSliceFunction · 0.85

Tested by 2

TestIndexOfSelectionFunction · 0.64