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

Running v1.56.0 version throws panics, v1.55.2 works fine #4361

Closed
5 tasks done
maksim-paskal opened this issue Feb 8, 2024 · 6 comments
Closed
5 tasks done

Running v1.56.0 version throws panics, v1.55.2 works fine #4361

maksim-paskal opened this issue Feb 8, 2024 · 6 comments
Labels
question Further information is requested

Comments

@maksim-paskal
Copy link

maksim-paskal commented Feb 8, 2024

Welcome

Description of the problem

Running today latest version

go run github.com/golangci/golangci-lint/cmd/[email protected] run -v

throws panics

ERRO Running error: can't run linter goanalysis_metalinter
goanalysis_metalinter: interfacer: package "main" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference 
#.golangci.yml
run:
  timeout: 5m
issues:
  fix: true
linters:
  enable-all: true
  disable:
  - gochecknoglobals
  - exhaustivestruct
  - exhaustruct
  - varnamelen
  - musttag
  - depguard

Version of golangci-lint

> go run github.com/golangci/golangci-lint/cmd/[email protected] --version
golangci-lint has version v1.56.0 built with go1.21.5 from (unknown, mod sum: "h1:uivqYQ8WbkWAE4LgjLLhxsTyb68FlcZF3ZIF0oyn4WQ=") on (unknown)

Configuration

run:
  timeout: 5m
issues:
  fix: true
linters:
  enable-all: true
  disable:
  - gochecknoglobals
  - exhaustivestruct
  - exhaustruct
  - varnamelen
  - musttag
  - depguard

Go environment

go version go1.21.5 darwin/amd64

Verbose output of running

WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: interfacer: package "client" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference 
INFO [runner] processing took 3.335µs with stages: max_same_issues: 502ns, uniq_by_line: 411ns, skip_dirs: 334ns, nolint: 287ns, cgo: 203ns, source_code: 133ns, autogenerated_exclude: 130ns, filename_unadjuster: 127ns, fixer: 125ns, identifier_marker: 125ns, skip_files: 125ns, exclude: 125ns, path_prettifier: 120ns, exclude-rules: 119ns, max_from_linter: 111ns, diff: 67ns, path_shortener: 60ns, sort_results: 60ns, severity-rules: 59ns, max_per_file_from_linter: 58ns, path_prefixer: 54ns 
INFO [runner] linters took 16.579660199s with stages: goanalysis_metalinter: 16.579591126s 
ERRO Running error: can't run linter goanalysis_metalinter
goanalysis_metalinter: interfacer: package "client" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference 
INFO Memory: 168 samples, avg is 1038.6MB, max is 1648.4MB 
INFO Execution took 17.114056017s  

A minimal reproducible example or link to a public repository

https://github.com/maksim-paskal/aks-node-termination-handler

Validation

  • Yes, I've included all information above (version, config, etc.).
@maksim-paskal maksim-paskal added the bug Something isn't working label Feb 8, 2024
Copy link

boring-cyborg bot commented Feb 8, 2024

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

@ldez
Copy link
Member

ldez commented Feb 8, 2024

Hello @maksim-paskal,

interfacer is deprecated.

Can you add this to your configuration?

linters:
  enable-all: true
  disable:
    - deadcode # deprecated
    - exhaustivestruct # deprecated
    - golint # deprecated
    - ifshort # deprecated
    - interfacer # deprecated
    - maligned # deprecated
    - nosnakecase # deprecated
    - scopelint # deprecated
    - structcheck # deprecated
    - varcheck # deprecated
    - gochecknoglobals
    - exhaustivestruct
    - exhaustruct
    - varnamelen
    - musttag
    - depguard

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Feb 8, 2024
@maksim-paskal
Copy link
Author

@ldez thanks for quick answer, yes it helps

Do I need to add all deprecated linters now in my configuration?

@ldez
Copy link
Member

ldez commented Feb 8, 2024

I tried your repository and my suggestion fix your problem.

Interfacer is a very very old linter, deprecated for years.

Do I need to add all deprecated linters now in my configuration?

yes

@ldez ldez closed this as completed Feb 8, 2024
@maksim-paskal
Copy link
Author

@ldez how about disable-deprecated: true?

#.golangci.yml
run:
  timeout: 5m
issues:
  fix: true
linters:
  enable-all: true
  disable-deprecated: true
  disable:
  - gochecknoglobals
  - exhaustivestruct
  - exhaustruct
  - varnamelen
  - musttag
  - depguard

I try to use all new linters by default. I did not pay attention to deprecated linters, perhaps other users do the same.

@ldez
Copy link
Member

ldez commented Feb 8, 2024

The lifecycle deprecated linters is something discussed in #1987.

FYI the deprecation are displayed when you run golangci-lint:

$ golangci-lint run
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. 
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. 
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.  
WARN [runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming). 
WARN [runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'. 
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive. 
WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref. 
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. 
WARN [runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. 

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