Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby committed Dec 15, 2023
1 parent a620003 commit 7fd9756
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/grpcwrapper/rawtopic/rawtopicwriter/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ func (d *MessageData) ToProto() (*Ydb_Topic.StreamWriteMessage_WriteRequest_Mess
return nil, err
}

for _, item := range d.MetadataItems {
for i := range d.MetadataItems {
res.MetadataItems = append(res.MetadataItems, &Ydb_Topic.MetadataItem{
Key: item.Key,
Value: item.Value,
Key: d.MetadataItems[i].Key,
Value: d.MetadataItems[i].Value,
})
}

Expand Down
4 changes: 2 additions & 2 deletions internal/topic/topicreaderinternal/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func newBatchFromStream(

if len(sMess.MetadataItems) > 0 {
dstMess.Metadata = make(map[string][]byte, len(sMess.MetadataItems))
for _, item := range sMess.MetadataItems {
dstMess.Metadata[item.Key] = item.Value
for metadataIndex := range sMess.MetadataItems {
dstMess.Metadata[sMess.MetadataItems[metadataIndex].Key] = sMess.MetadataItems[metadataIndex].Value
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func TestWriterImpl_Write(t *testing.T) {
require.NoError(t, err)
mess.metadataCached = true
expectedMap[k] = mess

}

require.Equal(t, expectedMap, w.queue.messagesByOrder)
Expand Down

0 comments on commit 7fd9756

Please sign in to comment.