Last returns the last [PathStep] in the Path. If the path is empty, this returns a non-nil [PathStep] that reports a nil [PathStep.Type].
()
| 79 | // If the path is empty, this returns a non-nil [PathStep] |
| 80 | // that reports a nil [PathStep.Type]. |
| 81 | func (pa Path) Last() PathStep { |
| 82 | return pa.Index(-1) |
| 83 | } |
| 84 | |
| 85 | // Index returns the ith step in the Path and supports negative indexing. |
| 86 | // A negative index starts counting from the tail of the Path such that -1 |