Index reports the index >= 0 of the current Node in the slice of Nodes that contains it, or a value < 0 if the current Node is not part of a slice. The index of the current node changes if InsertBefore is called while processing the current node.
()
| 90 | // The index of the current node changes if InsertBefore is called while |
| 91 | // processing the current node. |
| 92 | func (c *Cursor) Index() int { |
| 93 | if c.iter != nil { |
| 94 | return c.iter.index |
| 95 | } |
| 96 | return -1 |
| 97 | } |
| 98 | |
| 99 | // field returns the current node's parent field value. |
| 100 | func (c *Cursor) field() reflect.Value { |
no outgoing calls