MCPcopy Index your code
hub / github.com/PuerkitoBio/goquery / IndexOfNode

Method IndexOfNode

array.go:113–115  ·  view source on GitHub ↗

IndexOfNode returns the position of the specified node within the Selection object, or -1 if not found.

(node *html.Node)

Source from the content-addressed store, hash-verified

111// IndexOfNode returns the position of the specified node within the Selection
112// object, or -1 if not found.
113func (s *Selection) IndexOfNode(node *html.Node) int {
114 return indexInSlice(s.Nodes, node)
115}
116
117// IndexOfSelection returns the position of the first node in the specified
118// Selection object within this Selection object, or -1 if not found.

Callers 3

TestIndexOfNodeFunction · 0.80
TestIndexOfNilNodeFunction · 0.80
BenchmarkIndexOfNodeFunction · 0.80

Calls 1

indexInSliceFunction · 0.85

Tested by 3

TestIndexOfNodeFunction · 0.64
TestIndexOfNilNodeFunction · 0.64
BenchmarkIndexOfNodeFunction · 0.64