Skip to content

Refactor To function to use new for pointer creation - #357

Open
janisz wants to merge 2 commits into
kubernetes:masterfrom
janisz:patch-1
Open

Refactor To function to use new for pointer creation#357
janisz wants to merge 2 commits into
kubernetes:masterfrom
janisz:patch-1

Conversation

@janisz

@janisz janisz commented Aug 3, 2026

Copy link
Copy Markdown

Updated To function to use new instead of address-of operator.

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug

/kind cleanup

/kind design
/kind documentation
/kind test
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

We don't need To function anymore as it's now built in new functionality.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Release note:


@kubernetes-prow kubernetes-prow Bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 3, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from skitt and thockin August 3, 2026 11:11
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 3, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @janisz!

It looks like this is your first PR to kubernetes/utils 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/utils has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 3, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: janisz
Once this PR has been reviewed and has the lgtm label, please assign thockin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment thread go.mod
module k8s.io/utils

go 1.25
go 1.26

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ptr/ptr.go

// To returns a pointer to the given value.
// Deprecated: Use new instead.
//go:fix inline

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my tests so far, Go 1.26 isn’t able to apply this fix inline 😦.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants