Conversation
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
puellanivis
left a comment
There was a problem hiding this comment.
I know it’s already merged, but spotted a few further polishings.
| for group, typ := range response.Groups { | ||
| groups[group] = typ | ||
| } | ||
| maps.Copy(groups, response.Groups) |
There was a problem hiding this comment.
Since we’re also making the map on line 1034, we can replace this with groups := maps.Clone(response.Groups)
| for k, v := range currentPartitionConsumer { | ||
| preBalancePartitionConsumers[k] = v | ||
| } | ||
| maps.Copy(preBalancePartitionConsumers, currentPartitionConsumer) |
There was a problem hiding this comment.
This is also a good candidate for maps.Clone
| for k, v := range preBalancePartitionConsumers { | ||
| currentPartitionConsumer[k] = v | ||
| } | ||
| maps.Copy(currentPartitionConsumer, preBalancePartitionConsumers) |
| } | ||
| } | ||
| return false | ||
| return slices.Contains(assignments, topic) |
There was a problem hiding this comment.
We might want to replace the actual function calls to this unexported function to slices.Contains itself?
| found := slices.Contains(consumers[memberID].Topics, assignedTopic) | ||
| if !found { |
There was a problem hiding this comment.
No need to go through a temporary local variable anymore, we could just do the slices.Contains directly in the if condition.
| for k, v := range handlerMap { | ||
| fnMap[k] = v | ||
| } | ||
| maps.Copy(fnMap, handlerMap) |
| for k, v := range handlerMap { | ||
| fnMap[k] = v | ||
| } | ||
| maps.Copy(fnMap, handlerMap) |
| arrHdrs := strings.SplitSeq(*headers, ",") | ||
| for h := range arrHdrs { |
There was a problem hiding this comment.
No need to pass this through a temporary local variable.
| resp := fmt.Appendf(nil, "n,,\x01auth=Bearer %s%s\x01\x01", token.Token, ext) | ||
|
|
||
| return resp, nil |
There was a problem hiding this comment.
This doesn’t seem to be necessary to pass through a temporary local variable, but the composed return might look more odd.
These are the uncontentious changes mentioned after the merge of the earlier modernize PR. See: IBM#3297 (review) Co-authored-by: Cassondra Foesch <[email protected]> Signed-off-by: beanz <[email protected]>
These are the uncontentious changes mentioned after the merge of the earlier modernize PR. See: IBM#3297 (review) Co-authored-by: Cassondra Foesch <[email protected]> Signed-off-by: beanz <[email protected]>
These are the uncontentious changes mentioned after the merge of the earlier modernize PR. See: #3297 (review) Co-authored-by: Cassondra Foesch <[email protected]> Signed-off-by: beanz <[email protected]>
Apply a selection of the gopls modernize fixes category-by-category: