mirror of
https://github.com/PuerkitoBio/goquery
synced 2025-10-17 14:11:16 +08:00
fix comment in Slice(), negative indices are now supported
This commit is contained in:
2
array.go
2
array.go
@@ -28,7 +28,7 @@ func (this *Selection) Eq(index int) *Selection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Slice() reduces the set of matched elements to a subset specified by a range
|
// Slice() reduces the set of matched elements to a subset specified by a range
|
||||||
// of indices. At the moment, negative indices are not supported.
|
// of indices.
|
||||||
func (this *Selection) Slice(start int, end int) *Selection {
|
func (this *Selection) Slice(start int, end int) *Selection {
|
||||||
if start < 0 {
|
if start < 0 {
|
||||||
start += len(this.Nodes)
|
start += len(this.Nodes)
|
||||||
|
Reference in New Issue
Block a user