Skip to content
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

golangci-lint v1.6.2 process killed on go v1.24 darwin #5596

Closed
6 of 7 tasks
Ale-Cas opened this issue Mar 24, 2025 · 2 comments
Closed
6 of 7 tasks

golangci-lint v1.6.2 process killed on go v1.24 darwin #5596

Ale-Cas opened this issue Mar 24, 2025 · 2 comments
Labels
question Further information is requested

Comments

@Ale-Cas
Copy link

Ale-Cas 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

It looks like golangci-lint v1.6.2 is somehow not compatible with go 1.24.0 running on darwin/arm64 (mac M1).
The linter gets killed on every command I'm running.
It might be related to this old thread: https://www.reddit.com/r/golang/comments/11l2zes/golangcilint_out_of_memory/

Image

Version of golangci-lint

$ golangci-lint --version
[1]    72725 killed     golangci-lint --version

Image

Configuration

---
linters-settings:
  dupl:
    threshold: 100
  exhaustive:
    default-signifies-exhaustive: false
  funlen:
    lines: 100
    statements: 50
  gci:
    sections:
      - standard
      - default
      - localmodule
  goconst:
    min-len: 2
    min-occurrences: 2
  gocritic:
    enabled-tags:
      - diagnostic
      - experimental
      - opinionated
      - performance
      - style
    disabled-checks:
      - dupImport # https://github.com/go-critic/go-critic/issues/845
      - ifElseChain
      - octalLiteral
      - whyNoLint
      - wrapperFunc
  gocyclo:
    min-complexity: 10
  goimports:
    local-prefixes: github.com/golangci/golangci-lint
  mnd:
    checks:
      - argument
      - case
      - condition
      - return
  govet:
    enable:
      - shadow
    settings:
      printf:
        funcs:
          - (gofr.dev/pkg/gofr/Logger).Logf
          - (gofr.dev/pkg/gofr/Logger).Errorf
  lll:
    line-length: 140
  misspell:
    locale: US
  nolintlint:
    allow-unused: false # report any unused nolint directives
    require-explanation: true # require an explanation for nolint directives
    require-specific: true # require nolint directives to be specific about which linter is being skipped
  usestdlibvars:
    time-layout: true # Suggest the use of constants available in time package
  revive:
    rules:
    # default revive rules, they have to be present otherwise they are disabled
      - name: blank-imports
      - name: context-as-argument
      - name: context-keys-type
      - name: dot-imports
      - name: empty-block
      - name: error-naming
      - name: error-return
      - name: error-strings
      - name: errorf
      - name: exported
        arguments:
          # enables checking public methods of private types
          - "checkPrivateReceivers"
          # make error messages clearer
          - "sayRepetitiveInsteadOfStutters"
      - name: increment-decrement
      - name: indent-error-flow
      - name: range
      - name: receiver-naming
      - name: redefines-builtin-id
      - name: superfluous-else
      - name: time-naming
      - name: unexported-return
      - name: unreachable-code
      - name: unused-parameter
      - name: var-declaration
      - name: var-naming
    # additional revive rules
      - name: bare-return
      - name: bool-literal-in-expr
      - name: comment-spacings
      - name: early-return
      - name: defer
      - name: deep-exit
      - name: unused-receiver
      - name: use-any

linters:
  # please, do not use `enable-all`: it's deprecated and will be removed soon.
  # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
  disable-all: true
  enable:
    - asciicheck
    - bodyclose
    - canonicalheader
    - copyloopvar
    - dogsled
    - dupl
    - err113
    - errcheck
    - errorlint
    - exhaustive
    - funlen
    - gci
    - gochecknoglobals
    - gochecknoinits
    - gocognit
    - goconst
    - gocritic
    - gocyclo
    - godot
    - gofmt
    - goprintffuncname
    - gosec
    - gosimple
    - govet
    - ineffassign
    - lll
    - mirror
    - misspell
    - mnd
    - nakedret
    - nestif
    - noctx
    - nolintlint
    - prealloc
    - revive
    - rowserrcheck
    - staticcheck
    - stylecheck
    - testifylint
    - thelper
    - unconvert
    - unparam
    - unused
    - usestdlibvars
    - whitespace
    - wsl

  # don't enable:
  # - godox  # Disabling because we need TODO lines at this stage of project.
  # - testpackage # We also need to do unit test for unexported functions. And adding _internal in all files is cumbersome.

issues:
  include:
    - EXC0014

  # exclude-use-default: false
  # exclude-use-default: false # By default, golangci-lint does not enforce comments on exported types. We want it.
  # Excluding configuration per-path, per-linter, per-text and per-source
  exclude-rules:
    - path: _test\.go
      linters:
        - gomnd
        - dupl
        - goconst

Go environment

$ go version && go env
go version go1.24.0 darwin/arm64
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/ale/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/ale/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/h0/_pkxhksx1rqgphbnwpbcdg5h0000gn/T/go-build3608870839=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/ale/Projects/personal/gofr/go.mod'
GOMODCACHE='/Users/ale/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/ale/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/ale/go/pkg/mod/golang.org/[email protected]'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/ale/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/ale/go/pkg/mod/golang.org/[email protected]/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK='/Users/ale/Projects/personal/gofr/go.work'
PKG_CONFIG='pkg-config'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v

Image

A minimal reproducible example or link to a public repository

I was running the configured linters for a PR on https://github.com/gofr-dev/gofr

Validation

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

Supporter

@Ale-Cas Ale-Cas 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.

@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

hello,

golangci-lint v1.62 doesn't support go1.24, please use golangci-lint v1.64.

#5225

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