"golang.org/x/exp/slices" => "slices" and go fmt
This commit is contained in:
@@ -16,8 +16,8 @@ type ConsumerGroupInstance struct {
|
||||
|
||||
func NewConsumerGroupInstance(instanceId string, maxPartitionCount int32) *ConsumerGroupInstance {
|
||||
return &ConsumerGroupInstance{
|
||||
InstanceId: ConsumerGroupInstanceId(instanceId),
|
||||
ResponseChan: make(chan *mq_pb.SubscriberToSubCoordinatorResponse, 1),
|
||||
InstanceId: ConsumerGroupInstanceId(instanceId),
|
||||
ResponseChan: make(chan *mq_pb.SubscriberToSubCoordinatorResponse, 1),
|
||||
MaxPartitionCount: maxPartitionCount,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ type TimestampStatus struct {
|
||||
|
||||
// RingBuffer represents a circular buffer to hold timestamps.
|
||||
type RingBuffer struct {
|
||||
buffer []*TimestampStatus
|
||||
head int
|
||||
size int
|
||||
buffer []*TimestampStatus
|
||||
head int
|
||||
size int
|
||||
maxTimestamp int64
|
||||
maxAllAckedTs int64
|
||||
}
|
||||
@@ -111,7 +111,7 @@ func (rb *RingBuffer) EnflightTimestamp(timestamp int64) {
|
||||
if rb.size < len(rb.buffer) {
|
||||
rb.size++
|
||||
} else {
|
||||
newBuf := newBuffer(2*len(rb.buffer))
|
||||
newBuf := newBuffer(2 * len(rb.buffer))
|
||||
for i := 0; i < rb.size; i++ {
|
||||
newBuf[i] = rb.buffer[(rb.head+len(rb.buffer)-rb.size+i)%len(rb.buffer)]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user