Returns the index of the target node in the slice, or -1.
(slice []*html.Node, node *html.Node)
| 113 | |
| 114 | // Returns the index of the target node in the slice, or -1. |
| 115 | func indexInSlice(slice []*html.Node, node *html.Node) int { |
| 116 | if node != nil { |
| 117 | for i, n := range slice { |
| 118 | if n == node { |
| 119 | return i |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | return -1 |
| 124 | } |
| 125 | |
| 126 | // Appends the new nodes to the target slice, making sure no duplicate is added. |
| 127 | // There is no check to the original state of the target slice, so it may still |
no outgoing calls
no test coverage detected
searching dependent graphs…