Skip to content

x/tools/go/analysis/passes/modernize: doesn't convert 'for i := 0; i < 10; i += 1 {}' #76977

@strager

Description

@strager

Go version

go version go1.25.4 darwin/arm64

Output of go env in your module/workspace:

n/a

What did you do?

for i := 0; i < 10; i += 1 {}

What did you see happen?

The rangeint modernize pass does not convert this loop into a for-range loop.

What did you expect to see?

I expect the pass to convert the loop into this:

for i := range 10 {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions