Skip to content

Commit 47a1399

Browse files
committed
Fix linter errors
1 parent 733bf8a commit 47a1399

35 files changed

+357
-407
lines changed

add_partitions_to_txn_request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestAddPartitionsToTxnRequest(t *testing.T) {
1919
ProducerID: 8000,
2020
ProducerEpoch: 0,
2121
TopicPartitions: map[string][]int32{
22-
"topic": []int32{1},
22+
"topic": {1},
2323
},
2424
}
2525

add_partitions_to_txn_response_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestAddPartitionsToTxnResponse(t *testing.T) {
2020
resp := &AddPartitionsToTxnResponse{
2121
ThrottleTime: 100 * time.Millisecond,
2222
Errors: map[string][]*PartitionError{
23-
"topic": []*PartitionError{&PartitionError{
23+
"topic": {{
2424
Err: ErrInvalidTxnState,
2525
Partition: 2,
2626
}},

admin.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ func (ca *clusterAdmin) Controller() (*Broker, error) {
133133
}
134134

135135
func (ca *clusterAdmin) CreateTopic(topic string, detail *TopicDetail, validateOnly bool) error {
136-
137136
if topic == "" {
138137
return ErrInvalidTopic
139138
}
@@ -308,7 +307,6 @@ func (ca *clusterAdmin) ListTopics() (map[string]TopicDetail, error) {
308307
}
309308

310309
func (ca *clusterAdmin) DeleteTopic(topic string) error {
311-
312310
if topic == "" {
313311
return ErrInvalidTopic
314312
}
@@ -379,7 +377,6 @@ func (ca *clusterAdmin) CreatePartitions(topic string, count int32, assignment [
379377
}
380378

381379
func (ca *clusterAdmin) DeleteRecords(topic string, partitionOffsets map[int32]int64) error {
382-
383380
if topic == "" {
384381
return ErrInvalidTopic
385382
}
@@ -433,7 +430,6 @@ func (ca *clusterAdmin) DeleteRecords(topic string, partitionOffsets map[int32]i
433430
}
434431

435432
func (ca *clusterAdmin) DescribeConfig(resource ConfigResource) ([]ConfigEntry, error) {
436-
437433
var entries []ConfigEntry
438434
var resources []*ConfigResource
439435
resources = append(resources, &resource)
@@ -466,7 +462,6 @@ func (ca *clusterAdmin) DescribeConfig(resource ConfigResource) ([]ConfigEntry,
466462
}
467463

468464
func (ca *clusterAdmin) AlterConfig(resourceType ConfigResourceType, name string, entries map[string]*string, validateOnly bool) error {
469-
470465
var resources []*AlterConfigsResource
471466
resources = append(resources, &AlterConfigsResource{
472467
Type: resourceType,
@@ -518,7 +513,6 @@ func (ca *clusterAdmin) CreateACL(resource Resource, acl Acl) error {
518513
}
519514

520515
func (ca *clusterAdmin) ListAcls(filter AclFilter) ([]ResourceAcls, error) {
521-
522516
request := &DescribeAclsRequest{AclFilter: filter}
523517

524518
if ca.conf.Version.IsAtLeast(V2_0_0_0) {
@@ -566,7 +560,6 @@ func (ca *clusterAdmin) DeleteACL(filter AclFilter, validateOnly bool) ([]Matchi
566560
for _, mACL := range fr.MatchingAcls {
567561
mAcls = append(mAcls, *mACL)
568562
}
569-
570563
}
571564
return mAcls, nil
572565
}
@@ -580,7 +573,6 @@ func (ca *clusterAdmin) DescribeConsumerGroups(groups []string) (result []*Group
580573
return nil, err
581574
}
582575
groupsPerBroker[controller] = append(groupsPerBroker[controller], group)
583-
584576
}
585577

586578
for broker, brokerGroups := range groupsPerBroker {
@@ -623,7 +615,6 @@ func (ca *clusterAdmin) ListConsumerGroups() (allGroups map[string]string, err e
623615
}
624616

625617
groupMaps <- groups
626-
627618
}(b, ca.conf)
628619
}
629620

admin_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,6 @@ func TestListConsumerGroups(t *testing.T) {
821821
if err != nil {
822822
t.Fatal(err)
823823
}
824-
825824
}
826825

827826
func TestListConsumerGroupsMultiBroker(t *testing.T) {
@@ -886,7 +885,6 @@ func TestListConsumerGroupsMultiBroker(t *testing.T) {
886885
if err != nil {
887886
t.Fatal(err)
888887
}
889-
890888
}
891889

892890
func TestListConsumerGroupOffsets(t *testing.T) {
@@ -915,7 +913,7 @@ func TestListConsumerGroupOffsets(t *testing.T) {
915913
}
916914

917915
response, err := admin.ListConsumerGroupOffsets(group, map[string][]int32{
918-
topic: []int32{0},
916+
topic: {0},
919917
})
920918
if err != nil {
921919
t.Fatalf("ListConsumerGroupOffsets failed with error %v", err)
@@ -934,7 +932,6 @@ func TestListConsumerGroupOffsets(t *testing.T) {
934932
if err != nil {
935933
t.Fatal(err)
936934
}
937-
938935
}
939936

940937
func TestDeleteConsumerGroup(t *testing.T) {
@@ -964,5 +961,4 @@ func TestDeleteConsumerGroup(t *testing.T) {
964961
if err != nil {
965962
t.Fatalf("DeleteConsumerGroup failed with error %v", err)
966963
}
967-
968964
}

alter_configs_request_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestAlterConfigsRequest(t *testing.T) {
5151
configValue := "1000"
5252
request = &AlterConfigsRequest{
5353
Resources: []*AlterConfigsResource{
54-
&AlterConfigsResource{
54+
{
5555
Type: TopicResource,
5656
Name: "foo",
5757
ConfigEntries: map[string]*string{
@@ -65,14 +65,14 @@ func TestAlterConfigsRequest(t *testing.T) {
6565

6666
request = &AlterConfigsRequest{
6767
Resources: []*AlterConfigsResource{
68-
&AlterConfigsResource{
68+
{
6969
Type: TopicResource,
7070
Name: "foo",
7171
ConfigEntries: map[string]*string{
7272
"segment.ms": &configValue,
7373
},
7474
},
75-
&AlterConfigsResource{
75+
{
7676
Type: TopicResource,
7777
Name: "bar",
7878
ConfigEntries: map[string]*string{

alter_configs_response_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestAlterConfigsResponse(t *testing.T) {
3333

3434
response = &AlterConfigsResponse{
3535
Resources: []*AlterConfigsResourceResponse{
36-
&AlterConfigsResourceResponse{
36+
{
3737
ErrorCode: 0,
3838
ErrorMsg: "",
3939
Type: TopicResource,

async_producer_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ func (l *testLogger) Println(v ...interface{}) {
328328
}
329329

330330
func TestAsyncProducerRecoveryWithRetriesDisabled(t *testing.T) {
331-
332331
tt := func(t *testing.T, kErr KError) {
333332
seedBroker := NewMockBroker(t, 1)
334333
leader1 := NewMockBroker(t, 2)

0 commit comments

Comments
 (0)