Does anybody know a linter that reports deprecated modules. #2598
-
| In my repo I have: $ go get .
go: module git.pnet.ch/zbindenren/depricon is deprecated: The latest supported version is github.com/peterbourgon/ff/v2.
$ echo $status
0$ golangci-lint run --enable-all
WARN [runner] golangci-lint run --enable-all
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 '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 '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 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner.  Replaced by exportloopref. 
$ golangci-lint --version
golangci-lint has version 1.44.0 built from 617470fa on 2022-01-25T11:31:17ZWould be great if  Hase someone a solution for this? | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
| @zbindenren, hi! I think such a linter will be different from existing in  I'm not sure there aren't any pitfalls here. Isn't it easier to add a check to CI based on the output from  | 
Beta Was this translation helpful? Give feedback.
@zbindenren, hi!
I think such a linter will be different from existing in
golangci-lint(e.g. depguard or gomodguard). Because it will not work with AST, but it will need to find the dependency in $GOPATH and parse itgo.mod(to find// Deprecated: ..., based on spec).I'm not sure there aren't any pitfalls here.
Isn't it easier to add a check to CI based on the output from
go getorgo list?Example: https://stackoverflow.com/a/71217351