Refactor To function to use new for pointer creation - #357
Conversation
Updated To function to use new instead of address-of operator. - https://go.dev/blog/inliner - https://go.dev/ref/spec#Allocation - golang/go#45624
|
Welcome @janisz! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: janisz 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 |
| module k8s.io/utils | ||
|
|
||
| go 1.25 | ||
| go 1.26 |
There was a problem hiding this comment.
k/utils has to support all current branches of k/k, so we can’t bump to Go 1.26 until Kubernetes 1.35 has reached EOL.
|
|
||
| // To returns a pointer to the given value. | ||
| // Deprecated: Use new instead. | ||
| //go:fix inline |
There was a problem hiding this comment.
From my tests so far, Go 1.26 isn’t able to apply this fix inline 😦.
Updated To function to use new instead of address-of operator.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
We don't need
Tofunction anymore as it's now built innewfunctionality.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: