Skip to content

v2.0.0: can't load config: typecheck is not a linter, it cannot be enabled or disabled #5610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 of 7 tasks
betacao opened this issue Mar 24, 2025 · 3 comments
Closed
6 of 7 tasks
Assignees
Labels
question Further information is requested

Comments

@betacao
Copy link

betacao commented Mar 24, 2025

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

How did you install golangci-lint?

go install

Description of the problem

I was using golangci-lint @1.64.8 and everything worked good.
After upgraded to 2.0.0, It reports following error:

golangci-lint run --fix
Error: can't load config: typecheck is not a linter, it cannot be enabled or disabled
Failed executing command with error: can't load config: typecheck is not a linter, it cannot be enabled or disabled

Version of golangci-lint

golangci-lint has version 2.0.0 built with go1.24.1 from f1f8343 on 2025-03-24T12:08:01Z

Configuration

# sample file:
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
linters-settings:
  govet:
    settings:
      printf:
        funcs:
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
  lll:
    line-length: 140
  funlen:
    ignore-comments: true

# Get all available linters by:
# $> golangci-lint help linters
linters:
  enable:
    - gosimple
    - govet
    - ineffassign
    - staticcheck
    - typecheck
    - unused
    - dupl
    - gofmt
    - gofumpt
    - bodyclose
    - errorlint
    - copyloopvar
    - funlen
    - gocognit
    - goconst
    - gocritic
    - gocyclo
    - goprintffuncname
    - gosec
    - stylecheck
    - whitespace

issues:
  exclude-rules:
    # Exclude following linters from running on tests files.
    - path: _test\.go
      linters:
        - errcheck
        - funlen
        - errorlint
        - typecheck
        - goconst
    - path: _test\.go
      text: "G601:"
      linters:
        - gosec
    - path: mocks/
      linters:
        - typecheck
    # Exclude proto package usage:
    # "Package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead."
    - linters:
        - staticcheck
      text: "SA1019:"
output:
  path-prefix: ""
  print-issued-lines: false
  print-linter-name: true

Go environment

go version go1.24.1 darwin/arm64
AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/xxx/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/xxx/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/tz/n59j788d1bx9qhdhh1c7hjgr0000gn/T/go-build3445869809=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/xxx/Documents/Github/main-app/go.mod'
GOMODCACHE='/Users/xxx/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/xxx/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.24.1/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/xxx/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.24.1/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.1'
GOWORK=''
PKG_CONFIG='pkg-config'

Verbose output of running

INFO golangci-lint has version 2.0.0 built with go1.24.1 from f1f8343 on 2025-03-24T12:08:01Z 
INFO [config_reader] Config search paths: [./ /Users/xxx/Documents/Github/main-app /Users/xxx/Documents/Github /Users/xxx/Documents /Users/xxx /Users /] 
INFO [config_reader] Used config file .golangci.yaml 
Error: can't load config: typecheck is not a linter, it cannot be enabled or disabled
Failed executing command with error: can't load config: typecheck is not a linter, it cannot be enabled or disabled

A minimal reproducible example or link to a public repository

// add your code here

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@betacao betacao added the bug Something isn't working label Mar 24, 2025
Copy link

boring-cyborg bot commented Mar 24, 2025

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@betacao
Copy link
Author

betacao commented Mar 24, 2025

similar issue: #5600
but no help!

@ldez ldez self-assigned this Mar 24, 2025
@ldez ldez added question Further information is requested and removed bug Something isn't working labels Mar 24, 2025
@ldez
Copy link
Member

ldez commented Mar 24, 2025

You should migrate your configuration: you are using configuration v1 with golangci-lint v2

I recommend using the migration command: https://golangci-lint.run/product/migration-guide/#command-migrate

@ldez ldez closed this as completed Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants