Skip to content

refactor: use stdlib maps and slices instead of golang.org/x/exp#9482

Open
mmmommm wants to merge 1 commit into
envoyproxy:mainfrom
mmmommm:replace_exp_maps_slices_module_with_std
Open

refactor: use stdlib maps and slices instead of golang.org/x/exp#9482
mmmommm wants to merge 1 commit into
envoyproxy:mainfrom
mmmommm:replace_exp_maps_slices_module_with_std

Conversation

@mmmommm

@mmmommm mmmommm commented Jul 13, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

While working on #9478, I noticed that several packages still import golang.org/x/exp/maps and golang.org/x/exp/slices, even though they only use functions that now have drop-in equivalents in the standard library maps/slices packages.

  • maps.Copy, maps.Clone
  • slices.Contains

These golang.org/x/exp functions also carry //go:fix inline directives, so gopls reports a should be inlined hint at every call site.

This PR replaces the golang.org/x/exp/maps and golang.org/x/exp/slices imports with the standard library maps/slices. The call sites are unchanged because the signatures are identical, and golang.org/x/exp is demoted to an indirect dependency in go.mod.

Functions whose standard-library form differs (e.g. maps.Keys/maps.Values, which return iterators in the stdlib) are not used anywhere, so this is a pure, behavior-preserving refactor.

Which issue(s) this PR fixes:

Fixes #


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

Signed-off-by: Kise Ryota <kiseryota.contact@gmail.com>
@mmmommm mmmommm marked this pull request as ready for review July 13, 2026 10:11
@mmmommm mmmommm requested a review from a team as a code owner July 13, 2026 10:11
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit d171630
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a54b9d86ef6a40008484353
😎 Deploy Preview https://deploy-preview-9482--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mmmommm

mmmommm commented Jul 13, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: d171630071

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant