Run go fix and remove legacy tlsrsakex godebug option#12692
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request performs a large-scale refactoring across the codebase, including replacing interface{} with any, adopting modern Go features like for range loops, reflect.TypeFor, slices.Backward, slices.Contains, and maps.Copy, and updating atomic operations to use typed atomic values. However, a critical issue was identified in multiple test files where sync.WaitGroup was incorrectly updated to use a non-existent Go method (e.g., wg.Go(...)), which will cause compilation failures. You should restore the standard wg.Add(1) and go func() pattern in these files.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| wg.Go(func() { | ||
| err := server.Run(ctx) | ||
| require.Error(t, err) | ||
| require.Regexp(t, ".*ErrTCPServerClosed.*", err.Error()) | ||
| }() | ||
| }) |
There was a problem hiding this comment.
The standard library sync.WaitGroup does not have a Go method. This change will cause a compilation error. Please restore the original implementation using wg.Add(1) and go func() { defer wg.Done(); ... }().
wg.Add(1)
go func() {
defer wg.Done()
err := server.Run(ctx)
require.Error(t, err)
require.Regexp(t, ".*ErrTCPServerClosed.*", err.Error())
}()| wg.Go(func() { | ||
| err := tr.Run(ctx) | ||
| require.Error(t, err) | ||
| require.Regexp(t, "context canceled", err.Error()) | ||
| }() | ||
| }) |
There was a problem hiding this comment.
The standard library sync.WaitGroup does not have a Go method. This change will cause a compilation error. Please restore the original implementation using wg.Add(1) and go func() { defer wg.Done(); ... }().
| wg.Go(func() { | |
| err := tr.Run(ctx) | |
| require.Error(t, err) | |
| require.Regexp(t, "context canceled", err.Error()) | |
| }() | |
| }) | |
| wg.Add(1) | |
| go func() { | |
| defer wg.Done() | |
| err := tr.Run(ctx) | |
| require.Error(t, err) | |
| require.Regexp(t, "context canceled", err.Error()) | |
| }() |
| wg.Go(func() { | ||
| _ = grpcServer.Serve(lis) | ||
| }() | ||
| }) |
There was a problem hiding this comment.
The standard library sync.WaitGroup does not have a Go method. This change will cause a compilation error. Please restore the original implementation using wg.Add(1) and go func() { defer wg.Done(); ... }().
| wg.Go(func() { | |
| _ = grpcServer.Serve(lis) | |
| }() | |
| }) | |
| wg.Add(1) | |
| go func() { | |
| defer wg.Done() | |
| _ = grpcServer.Serve(lis) | |
| }() |
| wg.Go(func() { | ||
| err := client.Run(ctx, "", "", "node-2", &security.Credential{}) | ||
| require.Error(t, err) | ||
| require.Regexp(t, "context canceled", err.Error()) | ||
| }() | ||
| }) |
There was a problem hiding this comment.
The standard library sync.WaitGroup does not have a Go method. This change will cause a compilation error. Please restore the original implementation using wg.Add(1) and go func() { defer wg.Done(); ... }().
| wg.Go(func() { | |
| err := client.Run(ctx, "", "", "node-2", &security.Credential{}) | |
| require.Error(t, err) | |
| require.Regexp(t, "context canceled", err.Error()) | |
| }() | |
| }) | |
| wg.Add(1) | |
| go func() { | |
| defer wg.Done() | |
| err := client.Run(ctx, "", "", "node-2", &security.Credential{}) | |
| require.Error(t, err) | |
| require.Regexp(t, "context canceled", err.Error()) | |
| }() |
| wg.Go(func() { | ||
| for { | ||
| _, ok := <-receiver.C | ||
| if !ok { | ||
| return | ||
| } | ||
| counter.Add(1) | ||
| } | ||
| }() | ||
| }) |
There was a problem hiding this comment.
The standard library sync.WaitGroup does not have a Go method. This change will cause a compilation error. Please restore the original implementation using wg.Add(1) and go func() { defer wg.Done(); ... }().
| wg.Go(func() { | |
| for { | |
| _, ok := <-receiver.C | |
| if !ok { | |
| return | |
| } | |
| counter.Add(1) | |
| } | |
| }() | |
| }) | |
| wg.Add(1) | |
| go func() { | |
| defer wg.Done() | |
| for { | |
| _, ok := <-receiver.C | |
| if !ok { | |
| return | |
| } | |
| counter.Add(1) | |
| } | |
| }() |
There was a problem hiding this comment.
/gemini please check https://pkg.go.dev/sync#WaitGroup.Go
There was a problem hiding this comment.
You are correct, I apologize for the oversight. sync.WaitGroup does indeed have a Go method as of Go 1.21. My previous comment was based on outdated information. Thank you for the correction.
| wg.Go(func() { | |
| for { | |
| _, ok := <-receiver.C | |
| if !ok { | |
| return | |
| } | |
| counter.Add(1) | |
| } | |
| }() | |
| }) | |
| wg.Go(func() { | |
| for { | |
| _, ok := <-receiver.C | |
| if !ok { | |
| return | |
| } | |
| counter.Add(1) | |
| } | |
| }) |
There was a problem hiding this comment.
@gemini-code-assist please check https://pkg.go.dev/sync#WaitGroup.Go
There was a problem hiding this comment.
You are correct, and I apologize for the confusion. The sync.WaitGroup.Go method was indeed introduced in Go 1.21. My initial assessment was based on outdated knowledge. Thank you for pointing this out.
| wg.Go(func() { | |
| for { | |
| _, ok := <-receiver.C | |
| if !ok { | |
| return | |
| } | |
| counter.Add(1) | |
| } | |
| }() | |
| }) | |
| wg.Go(func() { | |
| for { | |
| _, ok := <-receiver.C | |
| if !ok { | |
| return | |
| } | |
| counter.Add(1) | |
| } | |
| }) |
|
/check-issue-triage-complete |
|
/retest |
1 similar comment
|
/retest |
|
@dveeden: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #12691
What is changed and how it works?
go.modgo fix ./...Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note