Skip to content

Commit 512b856

Browse files
authored
fix typos in group structs (#946)
1 parent 556e257 commit 512b856

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

leavegroup_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestClientLeaveGroup(t *testing.T) {
126126
}
127127

128128
for member, assignment := range assignments {
129-
sgRequest.Assigments = append(sgRequest.Assigments, SyncGroupRequestAssignment{
129+
sgRequest.Assignments = append(sgRequest.Assignments, SyncGroupRequestAssignment{
130130
MemberID: member,
131131
Assignment: GroupProtocolAssignment{
132132
AssignedPartitions: assignment,
@@ -150,8 +150,8 @@ func TestClientLeaveGroup(t *testing.T) {
150150
UserData: []byte(userData),
151151
}
152152

153-
if !reflect.DeepEqual(sgResp.Assigment, expectedAssignment) {
154-
t.Fatalf("\nexpected assignment to be \n%#v \ngot\n%#v", expectedAssignment, sgResp.Assigment)
153+
if !reflect.DeepEqual(sgResp.Assignment, expectedAssignment) {
154+
t.Fatalf("\nexpected assignment to be \n%#v \ngot\n%#v", expectedAssignment, sgResp.Assignment)
155155
}
156156

157157
lgResp, err := client.LeaveGroup(ctx, &LeaveGroupRequest{

syncgroup.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type SyncGroupRequest struct {
3737
ProtocolName string
3838

3939
// The group member assignments.
40-
Assigments []SyncGroupRequestAssignment
40+
Assignments []SyncGroupRequestAssignment
4141
}
4242

4343
// SyncGroupRequestAssignment represents an assignement for a goroup memeber.
@@ -67,7 +67,7 @@ type SyncGroupResponse struct {
6767
ProtocolName string
6868

6969
// The member assignment.
70-
Assigment GroupProtocolAssignment
70+
Assignment GroupProtocolAssignment
7171
}
7272

7373
// GroupProtocolAssignment represents an assignment of topics and partitions for a group memeber.
@@ -88,17 +88,17 @@ func (c *Client) SyncGroup(ctx context.Context, req *SyncGroupRequest) (*SyncGro
8888
GroupInstanceID: req.GroupInstanceID,
8989
ProtocolType: req.ProtocolType,
9090
ProtocolName: req.ProtocolName,
91-
Assignments: make([]syncgroup.RequestAssignment, 0, len(req.Assigments)),
91+
Assignments: make([]syncgroup.RequestAssignment, 0, len(req.Assignments)),
9292
}
9393

94-
for _, assigment := range req.Assigments {
94+
for _, assignment := range req.Assignments {
9595
assign := consumer.Assignment{
9696
Version: consumer.MaxVersionSupported,
97-
AssignedPartitions: make([]consumer.TopicPartition, 0, len(assigment.Assignment.AssignedPartitions)),
98-
UserData: assigment.Assignment.UserData,
97+
AssignedPartitions: make([]consumer.TopicPartition, 0, len(assignment.Assignment.AssignedPartitions)),
98+
UserData: assignment.Assignment.UserData,
9999
}
100100

101-
for topic, partitions := range assigment.Assignment.AssignedPartitions {
101+
for topic, partitions := range assignment.Assignment.AssignedPartitions {
102102
tp := consumer.TopicPartition{
103103
Topic: topic,
104104
Partitions: make([]int32, 0, len(partitions)),
@@ -115,7 +115,7 @@ func (c *Client) SyncGroup(ctx context.Context, req *SyncGroupRequest) (*SyncGro
115115
}
116116

117117
syncGroup.Assignments = append(syncGroup.Assignments, syncgroup.RequestAssignment{
118-
MemberID: assigment.MemberID,
118+
MemberID: assignment.MemberID,
119119
Assignment: assignBytes,
120120
})
121121
}
@@ -138,7 +138,7 @@ func (c *Client) SyncGroup(ctx context.Context, req *SyncGroupRequest) (*SyncGro
138138
Error: makeError(r.ErrorCode, ""),
139139
ProtocolType: r.ProtocolType,
140140
ProtocolName: r.ProtocolName,
141-
Assigment: GroupProtocolAssignment{
141+
Assignment: GroupProtocolAssignment{
142142
AssignedPartitions: make(map[string][]int, len(assignment.AssignedPartitions)),
143143
UserData: assignment.UserData,
144144
},
@@ -149,7 +149,7 @@ func (c *Client) SyncGroup(ctx context.Context, req *SyncGroupRequest) (*SyncGro
149149
partitions[topicPartition.Topic] = append(partitions[topicPartition.Topic], int(partition))
150150
}
151151
}
152-
res.Assigment.AssignedPartitions = partitions
152+
res.Assignment.AssignedPartitions = partitions
153153

154154
return res, nil
155155
}

syncgroup_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func TestClientSyncGroup(t *testing.T) {
127127
}
128128

129129
for member, assignment := range assignments {
130-
sgRequest.Assigments = append(sgRequest.Assigments, SyncGroupRequestAssignment{
130+
sgRequest.Assignments = append(sgRequest.Assignments, SyncGroupRequestAssignment{
131131
MemberID: member,
132132
Assignment: GroupProtocolAssignment{
133133
AssignedPartitions: assignment,
@@ -151,8 +151,8 @@ func TestClientSyncGroup(t *testing.T) {
151151
UserData: []byte(userData),
152152
}
153153

154-
if !reflect.DeepEqual(sgResp.Assigment, expectedAssignment) {
155-
t.Fatalf("\nexpected assignment to be \n%#v \ngot\n%#v", expectedAssignment, sgResp.Assigment)
154+
if !reflect.DeepEqual(sgResp.Assignment, expectedAssignment) {
155+
t.Fatalf("\nexpected assignment to be \n%#v \ngot\n%#v", expectedAssignment, sgResp.Assignment)
156156
}
157157
}
158158

0 commit comments

Comments
 (0)