-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
gopls version
$ gopls -v version
Build info
----------
golang.org/x/tools/gopls v0.18.1
golang.org/x/tools/gopls@v0.18.1 h1:2xJBNzdImS5u/kV/ZzqDLSvlBSeZX+pWY9uKVP7Pask=
github.com/BurntSushi/toml@v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
github.com/google/go-cmp@v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/exp/typeparams@v0.0.0-20241210194714-1829a127f884 h1:1xaZTydL5Gsg78QharTwKfA9FY9CZ1VQj6D/AZEvHR0=
golang.org/x/mod@v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
golang.org/x/sync@v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/telemetry@v0.0.0-20241220003058-cc96b6e0d3d9 h1:L2k9GUV2TpQKVRGMjN94qfUMgUwOFimSQ6gipyJIjKw=
golang.org/x/text@v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/tools@v0.30.1-0.20250221230316-5055f70f240c h1:Ja/5gV5a9Vvho3p2NC/T2TtxhHjrWS/2DvCKMvA0a+Y=
golang.org/x/vuln@v1.1.3 h1:NPGnvPOTgnjBc9HTaUx+nj+EaUYxl5SJOWqaDYGaFYw=
honnef.co/go/tools@v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
mvdan.cc/gofumpt@v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
mvdan.cc/xurls/v2@v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.24.1 X:rangefunc
go env
<not relevant>What did you do?
I ran cmd/modernize on Gonum
What did you see happen?
it modernized this piece of code:
index 1cbb4444..8ed8cd2d 100644
--- a/internal/asm/f32/ge_test.go
+++ b/internal/asm/f32/ge_test.go
@@ -245,14 +245,11 @@ func gerData(m, n, incX, incY int) (x, y, a []float32) {
x = make([]float32, m*incX)
y = make([]float32, n*incY)
a = make([]float32, m*n)
- ln := len(x)
- if len(y) > ln {
- ln = len(y)
- }
+ ln := max(len(y), len(x))
if len(a) > ln {
ln = len(a)
}What did you expect to see?
it should (probably) have noticed the 3-way max:
index 1cbb4444..8ed8cd2d 100644
--- a/internal/asm/f32/ge_test.go
+++ b/internal/asm/f32/ge_test.go
@@ -245,14 +245,11 @@ func gerData(m, n, incX, incY int) (x, y, a []float32) {
x = make([]float32, m*incX)
y = make([]float32, n*incY)
a = make([]float32, m*n)
- ln := len(x)
- if len(y) > ln {
- ln = len(y)
- }
+ ln := max(len(y), len(x), len(a))
- if len(a) > ln {
- ln = len(a)
- }Editor and settings
No response
Logs
No response
adonovan, Jorropo and silverwind
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.