-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Currently, the Document type has 2 methods for looking up an element at an index: ElementAt and MustElementAt. Since they sort far apart and don't have the same prefix it is difficult for users to find. To enable a more discoverable API and to more closely align with the semantics of the slice type in Go, change ElementAt to just return the Element and panic if out of bounds, remove the MustElementAt method, and add an ElementAtOK method, which will return false if the index is out of bounds. This provides a safety option while also making the two methods more discoverable.