Skip to content

Conversation

@abhinav
Copy link
Contributor

@abhinav abhinav commented Oct 5, 2025

Run modernize over the repository to update old Go idioms.
Changes include:

for i := 0; i < N; i++            ->  for i := range N
interface{}                       ->  any
for k, v := range x { y[k] = v }  ->  maps.Copy(y, x)
HasPrefix+TrimPrefix              ->  CutPrefix

Change generated by running:

go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...

Run modernize over the repository to update old Go idioms.
Changes include:

    for i := 0; i < N; i++            ->  for i := range N
    interface{}                       ->  any
    for k, v := range x { y[k] = v }  ->  maps.Copy(y, x)
    HasPrefix+TrimPrefix              ->  CutPrefix

Change generated by running:

```
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
```
//go:generate mockgen -package empty_interface -destination mock.go -source input.go

type Empty interface{} // migrating interface{} -> any does not resolve to an interface type.
type Empty any // migrating interface{} -> any does not resolve to an interface type.
Copy link

Choose a reason for hiding this comment

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

this comment (and one above) doesn't seme to hold anymore? But also I don't understand what this means?

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.

4 participants