From 3684df2d9a725016cb46273acba230ab0b160088 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Tue, 31 Aug 2021 23:26:35 -0600 Subject: [PATCH] fetches: rename CollectRecords to Records 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. --- pkg/kgo/record_and_fetch.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/kgo/record_and_fetch.go b/pkg/kgo/record_and_fetch.go index 8b4c712d..edac0bce 100644 --- a/pkg/kgo/record_and_fetch.go +++ b/pkg/kgo/record_and_fetch.go @@ -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)