Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky committed Jan 21, 2025
1 parent 6196ce6 commit 21e495b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
34 changes: 17 additions & 17 deletions services/kinesis/kinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,23 @@ func (k *Kinesis) PutRecord(input PutRecordInput) (*PutRecordOutput, *awserrors.

// https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html
func (k *Kinesis) PutRecords(input PutRecordsInput) (*PutRecordsOutput, *awserrors.Error) {
putRecordsOutput := &PutRecordsOutput{}
for _, record := range input.Records {
putRecordOutput, err := k.PutRecord(PutRecordInput{
StreamName: input.StreamName,
Data: record.Data,
PartitionKey: record.PartitionKey,
ExplicitHashKey: record.ExplicitHashKey,
})
if err != nil {
return nil, err
}
putRecordsOutput.Records = append(putRecordsOutput.Records, PutRecordsOutputRecord{
SequenceNumber: putRecordOutput.SequenceNumber,
ShardId: putRecordOutput.ShardId,
})
}
return putRecordsOutput, nil
putRecordsOutput := &PutRecordsOutput{}
for _, record := range input.Records {
putRecordOutput, err := k.PutRecord(PutRecordInput{
StreamName: input.StreamName,
Data: record.Data,
PartitionKey: record.PartitionKey,
ExplicitHashKey: record.ExplicitHashKey,
})
if err != nil {
return nil, err
}
putRecordsOutput.Records = append(putRecordsOutput.Records, PutRecordsOutputRecord{
SequenceNumber: putRecordOutput.SequenceNumber,
ShardId: putRecordOutput.ShardId,
})
}
return putRecordsOutput, nil
}

func (k *Kinesis) lockedGetShard(streamName, shardId string) (*Shard, *awserrors.Error) {
Expand Down
26 changes: 13 additions & 13 deletions services/kinesis/kinesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,19 @@ func TestGetShardIterator(t *testing.T) {
t.Fatal(err)
}
}
putRecordsInput := PutRecordsInput{
StreamName: streamName,
}
for i := 2; i < 5; i++ {
putRecordsInput.Records = append(putRecordsInput.Records, PutRecordsRequestEntry{
PartitionKey: "key",
Data: strconv.Itoa(i),
})
}
_, err := k.PutRecords(putRecordsInput)
if err != nil {
t.Fatal(err)
}
putRecordsInput := PutRecordsInput{
StreamName: streamName,
}
for i := 2; i < 5; i++ {
putRecordsInput.Records = append(putRecordsInput.Records, PutRecordsRequestEntry{

Check failure on line 177 in services/kinesis/kinesis_test.go

View workflow job for this annotation

GitHub Actions / build

undefined: PutRecordsRequestEntry
PartitionKey: "key",
Data: strconv.Itoa(i),
})
}
_, err := k.PutRecords(putRecordsInput)

Check failure on line 182 in services/kinesis/kinesis_test.go

View workflow job for this annotation

GitHub Actions / build

no new variables on left side of :=
if err != nil {
t.Fatal(err)
}

shardsOutput, err := k.ListShards(ListShardsInput{
StreamName: streamName,
Expand Down
12 changes: 6 additions & 6 deletions services/kinesis/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type PutRecordOutput struct {
}

type PutRecordsInputRecord struct {
PartitionKey string
Data string
PartitionKey string
Data string
ExplicitHashKey string
}

type PutRecordsInput struct {
StreamName string
StreamARN string
Records []PutRecordsInputRecord
StreamName string
StreamARN string
Records []PutRecordsInputRecord
}

type PutRecordsOutputRecord struct {
Expand All @@ -48,7 +48,7 @@ type PutRecordsOutputRecord struct {
}

type PutRecordsOutput struct {
Records []PutRecordsOutputRecord
Records []PutRecordsOutputRecord
}

type GetShardIteratorInput struct {
Expand Down

0 comments on commit 21e495b

Please sign in to comment.