Skip to content

Remove newexpr lint suppression and adopt new(x) over ptr.To(x) #3488

@kunalmemane

Description

@kunalmemane

With Go 1.26, the modernize/newexpr linter suggests replacing ptr.To(x) (from k8s.io/utils/ptr) with the built-in new(x). Temporarily disabled this lint rule in .golangci.yml to unblock the v0.36.0-beta.0 dependency bump.

Follow-up work:

  • Replace all ~128 occurrences of ptr.To(x) with new(x) across the codebase
  • Remove the newexpr entry from modernize.disable in .golangci.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions