Skip to content

Remove the deprecated opensearch.ToPointer helper #871

Description

@sean-

Summary

opensearch.ToPointer is marked Deprecated and slated for removal. It is intentionally not part of the public API going forward — internal consumers use the unexported per-package ptr helper, and generated *Params fields no longer need a public wrapper.

Location

opensearch.go:638-647

// ToPointer converts any value to a pointer, mainly used for request parameters
//
// Deprecated: ToPointer will be removed before v5. The helper is intentionally not
// part of the public API going forward; consumers within this module use the
// unexported `ptr` defined per-package. Once the module's go directive moves
// to 1.26, callers can drop any wrapper in favor of the native new(value)
// form (e.g. new(false)).
func ToPointer[V any](value V) *V {
      return ptr(value)
}

Acceptance criteria

  • Remove the exported ToPointer function.
  • Remove its test (opensearch_internal_test.go:521 TestToPointer).
  • Confirm no non-test call sites remain in the tree (only the internal test currently references it).
  • CHANGELOG.md entry under the v5 Removed section.
  • Migration note in UPGRADING.md: callers replace opensearch.ToPointer(v) with their own one-line helper, or new(value) once Go 1.26 is the floor.

Out of scope

Deleting the unexported ptr helper (gated on the Go 1.26 directive bump — tracked separately).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions