diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ccac0f1..0f7ecb69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: test: strategy: matrix: - go-version: [1.21.x, 1.22.x] + go-version: [1.22.x, 1.23.x] runs-on: ubuntu-latest steps: - name: Install Go @@ -49,7 +49,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout code uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -77,7 +77,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout code uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index b6d3bfb4..128c5614 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -11,7 +11,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x - name: Checkout code uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: diff --git a/.github/workflows/metadata.yml b/.github/workflows/metadata.yml index e0dced71..cee511a1 100644 --- a/.github/workflows/metadata.yml +++ b/.github/workflows/metadata.yml @@ -12,7 +12,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x - name: Checkout code uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index f411d16f..af4ec238 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -52,7 +52,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -98,7 +98,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -145,7 +145,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -180,7 +180,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -217,7 +217,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -252,7 +252,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -290,7 +290,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -325,7 +325,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -360,7 +360,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -395,7 +395,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -445,7 +445,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -496,7 +496,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -549,7 +549,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -602,7 +602,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -647,7 +647,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -682,7 +682,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -719,7 +719,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -756,7 +756,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -791,7 +791,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -826,7 +826,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -837,7 +837,7 @@ jobs: uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: repository: golang/crypto - ref: 089bfa5675191fd96a44247682f76ebca03d7916 + ref: v0.24.0 path: crypto persist-credentials: false - name: Avo Module Replacement @@ -861,7 +861,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -896,7 +896,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -936,7 +936,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -971,7 +971,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -982,7 +982,7 @@ jobs: uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: repository: golang/go - ref: go1.20.1 + ref: go1.23.4 path: go persist-credentials: false - name: Compile Go Toolchain @@ -1009,7 +1009,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -1020,7 +1020,7 @@ jobs: uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: repository: golang/go - ref: go1.20.1 + ref: go1.23.4 path: go persist-credentials: false - name: Compile Go Toolchain @@ -1047,7 +1047,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -1082,7 +1082,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -1117,7 +1117,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 @@ -1152,7 +1152,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout avo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 diff --git a/.github/workflows/stress.yml b/.github/workflows/stress.yml index d4142d93..2a444c6a 100644 --- a/.github/workflows/stress.yml +++ b/.github/workflows/stress.yml @@ -13,7 +13,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout code uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 diff --git a/.github/workflows/thirdparty.yml b/.github/workflows/thirdparty.yml index 4ee4f751..7f628a42 100644 --- a/.github/workflows/thirdparty.yml +++ b/.github/workflows/thirdparty.yml @@ -18,7 +18,7 @@ jobs: - name: Install Go uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 with: - go-version: 1.22.x + go-version: 1.23.x check-latest: true - name: Checkout code uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 diff --git a/.golangci.yml b/.golangci.yml index c2b9388a..c58a1801 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,11 +4,10 @@ linters: enable-all: true disable: - cyclop - - deadcode - dupword + - err113 - errname - exhaustruct - - exhaustivestruct - forbidigo - forcetypeassert - funlen @@ -16,29 +15,22 @@ linters: - gochecknoinits - goconst - godox - - goerr113 - - golint - - gomnd - gosec - - ifshort + - iface - inamedparam - - interfacer - ireturn - lll - - maligned + - mnd - nlreturn - nonamedreturns - - nosnakecase - paralleltest - - prealloc - perfsprint + - prealloc + - recvcheck - rowserrcheck - - scopelint - - structcheck - tagliatelle - testpackage - unparam - - varcheck - varnamelen - wastedassign - wrapcheck diff --git a/build/error.go b/build/error.go index d6f3be64..417a5d94 100644 --- a/build/error.go +++ b/build/error.go @@ -73,13 +73,13 @@ func (e ErrorList) Error() string { } // LogError logs a list of errors, one error per line, if the err parameter is -// an ErrorList. Otherwise it just logs the err string. Reports at most max -// errors, or unlimited if max is 0. -func LogError(l *log.Logger, err error, max int) { +// an ErrorList. Otherwise it just logs the err string. Reports at most mx +// errors, or unlimited if mx is 0. +func LogError(l *log.Logger, err error, mx int) { var list ErrorList if errors.As(err, &list) { for i, e := range list { - if max > 0 && i == max { + if mx > 0 && i == mx { l.Print("too many errors") return } diff --git a/go.mod b/go.mod index f23239fc..9e3bc0aa 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ toolchain go1.22.7 require ( golang.org/x/arch v0.12.0 - golang.org/x/sys v0.27.0 - golang.org/x/tools v0.27.0 + golang.org/x/sys v0.28.0 + golang.org/x/tools v0.28.0 ) require ( golang.org/x/mod v0.22.0 // indirect - golang.org/x/sync v0.9.0 // indirect + golang.org/x/sync v0.10.0 // indirect ) diff --git a/go.sum b/go.sum index 7affc9a4..fb7f3baf 100644 --- a/go.sum +++ b/go.sum @@ -4,9 +4,9 @@ golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= diff --git a/gotypes/components.go b/gotypes/components.go index fe0c9733..c5e6fada 100644 --- a/gotypes/components.go +++ b/gotypes/components.go @@ -190,7 +190,7 @@ func (c *component) Field(n string) Component { // } // fields := make([]*types.Var, s.NumFields()) - for i := 0; i < s.NumFields(); i++ { + for i := range s.NumFields() { fields[i] = s.Field(i) } offsets := Sizes.Offsetsof(fields) diff --git a/gotypes/components_test.go b/gotypes/components_test.go index 2de74916..7f5c97ba 100644 --- a/gotypes/components_test.go +++ b/gotypes/components_test.go @@ -192,7 +192,7 @@ func TestComponentDeconstruction(t *testing.T) { // For every test case, generate the same case but when the type is wrapped in // a named type. n := len(cases) - for i := 0; i < n; i++ { + for i := range n { wrapped := cases[i] wrapped.Name += "_wrapped" wrapped.Type = types.NewNamed( @@ -204,7 +204,6 @@ func TestComponentDeconstruction(t *testing.T) { } for _, c := range cases { - c := c // avoid scopelint error t.Run(c.Name, func(t *testing.T) { t.Log(c.Type) base := operand.NewParamAddr("test", 0) diff --git a/gotypes/signature.go b/gotypes/signature.go index a96b056e..9e90ce64 100644 --- a/gotypes/signature.go +++ b/gotypes/signature.go @@ -131,7 +131,7 @@ func newTuple(t *types.Tuple, offsets []int64, size int64, defaultprefix string) byname: map[string]Component{}, size: int(size), } - for i := 0; i < t.Len(); i++ { + for i := range t.Len() { v := t.At(i) name := v.Name() if name == "" { @@ -172,7 +172,7 @@ func (t *Tuple) Bytes() int { return t.size } func tuplevars(t *types.Tuple) []*types.Var { vs := make([]*types.Var, t.Len()) - for i := 0; i < t.Len(); i++ { + for i := range t.Len() { vs[i] = t.At(i) } return vs diff --git a/gotypes/signature_test.go b/gotypes/signature_test.go index 07a95c58..6fab939b 100644 --- a/gotypes/signature_test.go +++ b/gotypes/signature_test.go @@ -143,7 +143,7 @@ func TypesTuplesEqual(a, b *types.Tuple) bool { return false } n := a.Len() - for i := 0; i < n; i++ { + for i := range n { if !TypesVarsEqual(a.At(i), b.At(i)) { return false } diff --git a/internal/api/function.go b/internal/api/function.go index 1ae795cc..5b3fad47 100644 --- a/internal/api/function.go +++ b/internal/api/function.go @@ -97,7 +97,7 @@ func (f *Function) Signature() Signature { n := f.Arity() ops := make([]string, n) count := map[string]int{} - for j := 0; j < n; j++ { + for j := range n { // Collect unique lowercase bytes from first characters of operand types. s := map[byte]bool{} for _, form := range f.Forms { diff --git a/internal/api/function_test.go b/internal/api/function_test.go index 0c348b62..3e4b31fc 100644 --- a/internal/api/function_test.go +++ b/internal/api/function_test.go @@ -12,7 +12,6 @@ func TestFunctionsDuplicateFormSignatures(t *testing.T) { // manifest as duplicate case statements in generated code. fns := InstructionsFunctions(inst.Instructions) for _, fn := range fns { - fn := fn // scopelint t.Run(fn.Name(), func(t *testing.T) { seen := map[string]bool{} for _, f := range fn.Forms { @@ -36,7 +35,7 @@ func TestFunctionsUniqueArgNames(t *testing.T) { continue } names := map[string]bool{} - for j := 0; j < n; j++ { + for j := range n { names[s.ParameterName(j)] = true } if len(names) != n { diff --git a/internal/gen/optab.go b/internal/gen/optab.go index ca51c33a..34e37eca 100644 --- a/internal/gen/optab.go +++ b/internal/gen/optab.go @@ -58,18 +58,18 @@ func (t *optab) Generate(is []inst.Instruction) ([]byte, error) { } func (t *optab) maxOperands(is []inst.Instruction) { - max := 0 + mx := 0 for _, i := range inst.Instructions { for _, f := range i.Forms { a := len(f.Operands) + len(f.ImplicitOperands) - if a > max { - max = a + if a > mx { + mx = a } } } t.Comment("maxoperands is the maximum number of operands in an instruction form, including implicit operands.") - t.Printf("const maxoperands = %d\n\n", max) + t.Printf("const maxoperands = %d\n\n", mx) } func (t *optab) operandTypeEnum(is []inst.Instruction) { @@ -109,17 +109,17 @@ func (t *optab) implicitRegisterEnum(is []inst.Instruction) { func (t *optab) suffixesType(is []inst.Instruction) { // Declare the type as an array. This requires us to know the maximum number // of suffixes an instruction can have. - max := 0 + mx := 0 for _, class := range inst.SuffixesClasses(is) { for _, suffixes := range class { - if len(suffixes) > max { - max = len(suffixes) + if len(suffixes) > mx { + mx = len(suffixes) } } } t.Comment("maxsuffixes is the maximum number of suffixes an instruction can have.") - t.Printf("const maxsuffixes = %d\n\n", max) + t.Printf("const maxsuffixes = %d\n\n", mx) name := t.table.SuffixesTypeName() t.Printf("type %s [maxsuffixes]%s\n", name, t.table.Suffix().Name()) diff --git a/internal/inst/table_test.go b/internal/inst/table_test.go index d0eec144..38c2fa5f 100644 --- a/internal/inst/table_test.go +++ b/internal/inst/table_test.go @@ -44,7 +44,7 @@ func TestFormDupes(t *testing.T) { func HasFormDupe(i inst.Instruction) bool { n := len(i.Forms) - for a := 0; a < n; a++ { + for a := range n { for b := a + 1; b < n; b++ { if reflect.DeepEqual(i.Forms[a], i.Forms[b]) { return true diff --git a/internal/stack/stack.go b/internal/stack/stack.go index 1d327d9d..8a9fb856 100644 --- a/internal/stack/stack.go +++ b/internal/stack/stack.go @@ -7,10 +7,10 @@ import ( "strings" ) -// Frames returns at most max callstack Frames, starting with its caller and +// Frames returns at most mx callstack Frames, starting with its caller and // skipping skip Frames. -func Frames(skip, max int) []runtime.Frame { - pc := make([]uintptr, max) +func Frames(skip, mx int) []runtime.Frame { + pc := make([]uintptr, mx) n := runtime.Callers(skip+2, pc) if n == 0 { return nil diff --git a/internal/stack/stack_test.go b/internal/stack/stack_test.go index 4b833d16..eb48f26a 100644 --- a/internal/stack/stack_test.go +++ b/internal/stack/stack_test.go @@ -25,6 +25,7 @@ func TestMatchFirst(t *testing.T) { first := stack.Match(0, func(_ runtime.Frame) bool { return true }) if first == nil { t.Fatalf("nil match") + return } got := first.Function expect := pkg + ".TestMatchFirst" diff --git a/pass/alloc_test.go b/pass/alloc_test.go index cee9a9ef..0cc9b7ca 100644 --- a/pass/alloc_test.go +++ b/pass/alloc_test.go @@ -78,7 +78,7 @@ func TestAllocatorPriority(t *testing.T) { a.Add(x[i].ID()) } - for i := 0; i < n; i++ { + for i := range n { for j := i + 1; j < n; j++ { a.AddInterference(x[i].ID(), x[j].ID()) } diff --git a/pass/cfg.go b/pass/cfg.go index d5f6ea4e..687584f1 100644 --- a/pass/cfg.go +++ b/pass/cfg.go @@ -39,7 +39,7 @@ func CFG(fn *ir.Function) error { n := len(is) // Populate successors. - for i := 0; i < n; i++ { + for i := range n { cur := is[i] var nxt *ir.Instruction if i+1 < n { diff --git a/pass/reg_test.go b/pass/reg_test.go index 5c6b9c02..c4ec3698 100644 --- a/pass/reg_test.go +++ b/pass/reg_test.go @@ -120,7 +120,7 @@ func TestAllocateRegistersBasePointerDeprioritized(t *testing.T) { ctx.SignatureExpr("func() uint64") x := make([]reg.GPVirtual, n) - for i := 0; i < n; i++ { + for i := range n { x[i] = ctx.GP64() ctx.MOVQ(operand.U64(i), x[i]) } diff --git a/script/bootstrap b/script/bootstrap index 49af434b..4867e871 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -4,7 +4,7 @@ go install ./internal/cmd/asmvet # golangci-lint for linting -golangci_lint_version='v1.55.2' +golangci_lint_version='v1.62.2' golangci_install_script="https://raw.githubusercontent.com/golangci/golangci-lint/${golangci_lint_version}/install.sh" curl -sfL "${golangci_install_script}" | sh -s -- -b "$(go env GOPATH)/bin" "${golangci_lint_version}" diff --git a/tests/alloc/zeroing/zeroing_test.go b/tests/alloc/zeroing/zeroing_test.go index e28b3722..0dd2994b 100644 --- a/tests/alloc/zeroing/zeroing_test.go +++ b/tests/alloc/zeroing/zeroing_test.go @@ -21,7 +21,7 @@ func TestZeroing(t *testing.T) { var got [8]uint64 Zeroing(&got) - for i := 0; i < 8; i++ { + for i := range 8 { if got[i] != expect { t.Errorf("got[%d] = %d; expect %d", i, got[i], expect) } diff --git a/tests/fixedbugs/issue387/issue387_test.go b/tests/fixedbugs/issue387/issue387_test.go index 545a827f..410d1912 100644 --- a/tests/fixedbugs/issue387/issue387_test.go +++ b/tests/fixedbugs/issue387/issue387_test.go @@ -7,7 +7,7 @@ import ( //go:generate go run asm.go -out issue387.s -stubs stub.go func TestFloat32(t *testing.T) { - for i := 0; i < 10; i++ { + for i := range 10 { got := Float32(i) expect := float32(i) if got != expect { @@ -17,7 +17,7 @@ func TestFloat32(t *testing.T) { } func TestFloat64(t *testing.T) { - for i := 0; i < 10; i++ { + for i := range 10 { got := Float64(i) expect := float64(i) if got != expect { diff --git a/tests/thirdparty/config_test.go b/tests/thirdparty/config_test.go index 27a4e405..23b68961 100644 --- a/tests/thirdparty/config_test.go +++ b/tests/thirdparty/config_test.go @@ -94,7 +94,6 @@ func TestValidateErrors(t *testing.T) { }, } for _, c := range cases { - c := c // scopelint t.Run(c.Name, func(t *testing.T) { err := c.Item.Validate() if err == nil { diff --git a/tests/thirdparty/make_workflow.go b/tests/thirdparty/make_workflow.go index 19df2869..d2911e37 100644 --- a/tests/thirdparty/make_workflow.go +++ b/tests/thirdparty/make_workflow.go @@ -101,7 +101,7 @@ func GenerateWorkflow(s *thirdparty.Suite) ([]byte, error) { g.Linef("- name: Install Go") g.Linef(" uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1") g.Linef(" with:") - g.Linef(" go-version: 1.22.x") + g.Linef(" go-version: 1.23.x") g.Linef(" check-latest: true") // Checkout avo. diff --git a/tests/thirdparty/packages_test.go b/tests/thirdparty/packages_test.go index d34b9ceb..fce1fe6f 100644 --- a/tests/thirdparty/packages_test.go +++ b/tests/thirdparty/packages_test.go @@ -34,7 +34,6 @@ func TestPackages(t *testing.T) { } for _, tst := range s.Projects.Tests() { - tst := tst // scopelint t.Run(tst.ID(), func(t *testing.T) { if tst.Project.Skip() { t.Skipf("skip: %s", tst.Project.Reason()) diff --git a/tests/thirdparty/suite.json b/tests/thirdparty/suite.json index 12c80abe..2c97d4e5 100644 --- a/tests/thirdparty/suite.json +++ b/tests/thirdparty/suite.json @@ -649,7 +649,7 @@ "stars": 3031 }, "default_branch": "master", - "version": "089bfa5675191fd96a44247682f76ebca03d7916", + "version": "v0.24.0", "packages": [ { "pkg": "curve25519", @@ -761,7 +761,7 @@ "stars": 124357 }, "default_branch": "master", - "version": "go1.20.1", + "version": "go1.23.4", "packages": [ { "pkg": "src/crypto/internal/bigmod", diff --git a/x86/inst_test.go b/x86/inst_test.go index fb5b0f48..295a0fd8 100644 --- a/x86/inst_test.go +++ b/x86/inst_test.go @@ -78,7 +78,6 @@ func TestCases(t *testing.T) { } for _, c := range cases { - c := c // scopelint t.Run(c.Name, func(t *testing.T) { if !reflect.DeepEqual(c.Instruction, c.Expect) { t.Logf(" got = %#v", c.Instruction)