You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chipaca opened this issue
Mar 27, 2025
· 1 comment
Labels
BugReportIssues describing a possible bug in the Go implementation.goplsIssues related to the Go language server, gopls.ToolsThis label describes issues relating to any tools in the x/tools repository.
/home/john/.cache/go-build/54/542d18e8cf4015d5d32a5913f137addc33e0c03fb15b8e2990b3b4f334431680-d/modernize version devel comments-go-here buildID=542d18e8cf4015d5d32a5913f137addc33e0c03fb15b8e2990b3b4f334431680
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...
What did you see happen?
for loops like
for i = 0; i<N; i++ { ... }
getting changed to
for i = range N { ... }
when i is used after the loop; in the first case it will be N and in the second case it will be N-1 (ignoring other control flow).
What did you expect to see?
I expected the code to not behave differently after running modernize.
Editor and settings
editor was not involved in this
Logs
gopls wasn't involved (but I couldn't figure out a better template for this issue)
The text was updated successfully, but these errors were encountered:
chipaca
added
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
labels
Mar 27, 2025
BugReportIssues describing a possible bug in the Go implementation.goplsIssues related to the Go language server, gopls.ToolsThis label describes issues relating to any tools in the x/tools repository.
gopls version
but also
go env
What did you do?
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...
What did you see happen?
for loops like
getting changed to
when
i
is used after the loop; in the first case it will be N and in the second case it will be N-1 (ignoring other control flow).What did you expect to see?
I expected the code to not behave differently after running
modernize
.Editor and settings
editor was not involved in this
Logs
gopls wasn't involved (but I couldn't figure out a better template for this issue)
The text was updated successfully, but these errors were encountered: