Skip to content

Commit b602975

Browse files
committed
Use literal declaration in CommitMessage
1 parent 35ba317 commit b602975

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kafka/consumer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ func (c *Consumer) CommitMessage(m *Message) ([]TopicPartition, error) {
180180
if m.TopicPartition.Error != nil {
181181
return nil, KafkaError{ERR__INVALID_ARG, "Can't commit errored message"}
182182
}
183-
offsets := make([]TopicPartition, 1)
184-
offsets[0] = m.TopicPartition
183+
offsets := []TopicPartition{m.TopicPartition}
185184
offsets[0].Offset += 1
186185
return c.commit(offsets)
187186
}

0 commit comments

Comments
 (0)