Skip to content

Commit

Permalink
updated the Iterator interface docs for methods Key() and Value()
Browse files Browse the repository at this point in the history
  • Loading branch information
alesforz committed Jul 11, 2024
1 parent 8e8fc69 commit fa65ae2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ type Iterator interface {
// Key returns the key of the current key/value pair, or nil if done.
// The caller should not modify the contents of the returned slice, and
// its contents may change on the next call to any 'seeks method'.
// Instead, the caller should make a copy and work on the copy.
Key() (key []byte)

// Value returns the value at the current position. Panics if the iterator is invalid.
// Value returns the value of the current key/value pair, or nil if done.
// The caller should not modify the contents of the returned slice, and
// its contents may change on the next call to any 'seeks method'.
// Instead, the caller should make a copy and work on the copy.
Value() (value []byte)

// Error returns the last error encountered by the iterator, if any.
Expand Down

0 comments on commit fa65ae2

Please sign in to comment.