"golang.org/x/exp/slices" => "slices" and go fmt

This commit is contained in:
chrislu
2024-12-19 19:23:27 -08:00
parent a1a76ccb8c
commit ec155022e7
44 changed files with 70 additions and 71 deletions

View File

@@ -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,
}
}

View File

@@ -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)]
}