Skip to content

Commit

Permalink
fetches: rename CollectRecords to Records
Browse files Browse the repository at this point in the history
This mirrors the previously existing Errors method.

This is such minor breakage (function introduced in v0.10.3) that it's
not really worth noting.
  • Loading branch information
twmb committed Sep 1, 2021
1 parent 3c197a1 commit 3684df2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/kgo/record_and_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,12 @@ func (fs Fetches) EachRecord(fn func(*Record)) {
}
}

// CollectRecords returns all records in all fetches.
// Records returns all records in all fetches.
//
// This is a convenience function that does a single slice allocation.
func (fs Fetches) CollectRecords() []*Record {
// This is a convenience function that does a single slice allocation. If you
// can process records individually, it is far more efficient to use the Each
// functions or the RecordIter.
func (fs Fetches) Records() []*Record {
var n int
fs.EachPartition(func(p FetchTopicPartition) {
n += len(p.Records)
Expand Down

0 comments on commit 3684df2

Please sign in to comment.