Skip to content

Commit

Permalink
fix(selectors): document ranges in slice matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Aug 9, 2023
1 parent e4d81df commit a5beedf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions traversal/selector/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ type Matcher struct {
// The returned node will be limited based on slicing the specified range of the
// node into a new node, or making use of the `AsLargeBytes` io.ReadSeeker to
// restrict response with a SectionReader.
//
// Slice supports [From,To) ranges, where From is inclusive and To is exclusive.
// Negative values for From and To are interpreted as offsets from the end of
// the node. If To is greater than the node length, it will be truncated to the
// node length. If From is greater than the node length or greater than To, the
// result will be a non-match.
type Slice struct {
From int64
To int64
Expand Down

0 comments on commit a5beedf

Please sign in to comment.