From 744a60ed076730d50ff57688201d99c81d240c62 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Sun, 1 May 2022 18:23:11 -0600 Subject: [PATCH] Offset.AfterMilli: properly save noReset We returned a new offset, which was fine for the most part but we missed copying noReset. --- pkg/kgo/consumer.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/kgo/consumer.go b/pkg/kgo/consumer.go index 2924afc8..f94cb15f 100644 --- a/pkg/kgo/consumer.go +++ b/pkg/kgo/consumer.go @@ -88,10 +88,11 @@ func NoResetOffset() Offset { // timestamp. You can use NoResetOffset().AfterMilli(...) to instead switch the // client to a fatal state. func (o Offset) AfterMilli(millisec int64) Offset { - return Offset{ - at: millisec, - afterMilli: true, - } + o.at = millisec + o.relative = 0 + o.epoch = -1 + o.afterMilli = true + return o } // AtStart returns a copy of the calling offset, changing the returned offset