Skip to content

Modernize tidb code, by gpls modernize analysis #60323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mjonss opened this issue Mar 28, 2025 · 2 comments · May be fixed by #60324
Open

Modernize tidb code, by gpls modernize analysis #60323

mjonss opened this issue Mar 28, 2025 · 2 comments · May be fixed by #60324
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@mjonss
Copy link
Contributor

mjonss commented Mar 28, 2025

Enhancement

There have been several new features that simplifies go code in later versions (go 1.24), like:

  • range over a number
  • min/max generics
  • slices.Contains()
  • slices.Concat()
  • slices.Clone()
  • fmt.Appedf()
  • maps.Copy()
    ...

it can all be fixed by running:

go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
@mjonss mjonss added the type/enhancement The issue or PR belongs to an enhancement. label Mar 28, 2025
@mjonss mjonss linked a pull request Mar 28, 2025 that will close this issue
13 tasks
@dveeden
Copy link
Contributor

dveeden commented Mar 28, 2025

@mjonss
Copy link
Contributor Author

mjonss commented Mar 29, 2025

Maybe to be considered as a part of #59577.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants