From 1979e7c6e75005b7752de663a0c4cc1fb43e6dfd Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 26 Oct 2026 18:48:58 +0200 Subject: [PATCH] ci: let golangci-lint track the Go toolchain The lint job takes go-version: stable but pinned golangci-lint to v2.11.4, so once Go 1.27 became stable the linter could no longer read the standard library's export data and every stdlib import failed to typecheck. Nothing had run it since August, so it broke quietly. Float the version, as the oasdiff repo does, and settle what the newer linters then report: reflect.Ptr becomes reflect.Pointer in fields.go, and goconst leaves test files alone. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017e285CvofYf6joqC98gTXz --- .github/workflows/lint.yaml | 2 +- .golangci.yml | 4 ++++ fields.go | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index fc3b043..bc098ea 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -23,4 +23,4 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v9 with: - version: v2.11.4 + version: latest diff --git a/.golangci.yml b/.golangci.yml index 1324e85..d4c9a1b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,10 @@ linters: - unparam - unused settings: + goconst: + # A literal repeated across table-driven test cases reads better than a + # constant the reader has to look up. + ignore-tests: true govet: enable: - shadow diff --git a/fields.go b/fields.go index 3fe5f12..e29b57b 100644 --- a/fields.go +++ b/fields.go @@ -24,7 +24,7 @@ func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.Te // If v is a named type and is addressable, // start with its address, so that if the type has pointer methods, // we find them. - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { + if v.Kind() != reflect.Pointer && v.Type().Name() != "" && v.CanAddr() { v = v.Addr() } for { @@ -32,17 +32,17 @@ func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.Te // usefully addressable. if v.Kind() == reflect.Interface && !v.IsNil() { e := v.Elem() - if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { + if e.Kind() == reflect.Pointer && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Pointer) { v = e continue } } - if v.Kind() != reflect.Ptr { + if v.Kind() != reflect.Pointer { break } - if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { + if v.Elem().Kind() != reflect.Pointer && decodingNull && v.CanSet() { break } if v.IsNil() { @@ -171,7 +171,7 @@ func typeFields(t reflect.Type) []field { index[len(f.index)] = i ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { + if ft.Name() == "" && ft.Kind() == reflect.Pointer { // Follow pointer. ft = ft.Elem() }