Run go fix with go1.26#12715
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 |
|
/cc @OliverS929 @kennytm |
There was a problem hiding this comment.
Code Review
This pull request performs a large-scale refactoring across the codebase, replacing interface{} with any, adopting Go 1.21+ features like slices.Sort, slices.Contains, and maps.Copy, and simplifying loops using for range. However, several critical compilation errors were introduced where a non-existent Go method is called on sync.WaitGroup instead of errgroup.Group. Additionally, there are opportunities to optimize string building using fmt.Fprintf on strings.Builder and to simplify boolean assignments using slices.Contains directly.
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.
Codecov Report❌ Patch coverage is Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #12715 +/- ##
================================================
+ Coverage 53.6242% 55.8235% +2.1993%
================================================
Files 1038 737 -301
Lines 146348 87069 -59279
================================================
- Hits 78478 48605 -29873
+ Misses 61961 35005 -26956
+ Partials 5909 3459 -2450 🚀 New features to boost your workflow:
|
|
/cc @wuhuizuo |
| setFK = true | ||
| } | ||
| dsn += fmt.Sprintf("&%s='%s'", key, url.QueryEscape(val)) | ||
| dsn.WriteString(fmt.Sprintf("&%s='%s'", key, url.QueryEscape(val))) |
There was a problem hiding this comment.
| dsn.WriteString(fmt.Sprintf("&%s='%s'", key, url.QueryEscape(val))) | |
| fmt.Fprintf(&dsn, "&%s='%s'", key, url.QueryEscape(val)) |
| locks := make(map[string]*Lock, len(lk.locks)) | ||
| for k, v := range lk.locks { | ||
| locks[k] = v | ||
| } | ||
| maps.Copy(locks, lk.locks) |
There was a problem hiding this comment.
| locks := make(map[string]*Lock, len(lk.locks)) | |
| for k, v := range lk.locks { | |
| locks[k] = v | |
| } | |
| maps.Copy(locks, lk.locks) | |
| locks := maps.Clone(lk.locks) |
| } | ||
| } | ||
| return false | ||
| return slices.Contains(s, e) |
There was a problem hiding this comment.
better find out who calls contains and replace them with slice.Contains
| locks := make(map[string]*Lock, len(lk.locks)) | ||
| for k, v := range lk.locks { | ||
| locks[k] = v | ||
| } | ||
| maps.Copy(locks, lk.locks) |
There was a problem hiding this comment.
| locks := make(map[string]*Lock, len(lk.locks)) | |
| for k, v := range lk.locks { | |
| locks[k] = v | |
| } | |
| maps.Copy(locks, lk.locks) | |
| locks := maps.Clone(lk.locks) |
| ret := make(map[string]bool, len(l.ready)) | ||
| for k, v := range l.ready { | ||
| ret[k] = v | ||
| } | ||
| maps.Copy(ret, l.ready) |
There was a problem hiding this comment.
| ret := make(map[string]bool, len(l.ready)) | |
| for k, v := range l.ready { | |
| ret[k] = v | |
| } | |
| maps.Copy(ret, l.ready) | |
| ret := maps.Clone(l.ready) |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: kennytm <kennytm@gmail.com>
Co-authored-by: kennytm <kennytm@gmail.com>
Replace the make + maps.Copy pattern with maps.Clone where a fresh map is created and fully populated from a source map. Applies the PR review suggestions and the same simplification found elsewhere in the codebase. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@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. |
|
I'm closing this PR and I'm going to split it up into multiple PRs:
|
What problem does this PR solve?
Issue Number: ref #12691
What is changed and how it works?
Same as #12692 but with Go 1.26 and without removing the GODEBUG options that are removed in Go 1.27.
This can be applied to make the change in #12692 smaller
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