Add useany linter: Detect interface{} and suggest replacing with any
π New Features
New Linter: useany
Added a new golangci-lint plugin that detects interface{}
usage and suggests replacing it with any
(Go 1.18+).
Key Features:
- π Detects
interface{}
in all contexts (variables, functions, structs, etc.) - π οΈ Full auto-fix support with
golangci-lint --fix
- π― Only targets empty interfaces, won't flag interfaces with methods
Example:
// Before
var data interface{}
// After (with --fix)
var data any
Installation:
- Add to
.custom-gcl.yml
:
plugins:
- module: 'github.com/qor5/linter'
import: 'github.com/qor5/linter/useany'
- Enable in
.golangci.yml
:
linters:
enable:
- useany
π Bug Fixes
- Fixed CI test dependencies for
errhandle
andmustreceive
packages