-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnilinterface.go
More file actions
30 lines (23 loc) · 786 Bytes
/
nilinterface.go
File metadata and controls
30 lines (23 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// nilinterface module plugin for golangci-lint modeled on
// https://github.com/golangci/example-plugin-module-linter/blob/main/example.go
package nilinterface
import (
"github.com/lukasschwab/nilinterface/pkg/analyzer"
"github.com/golangci/plugin-module-register/register"
"golang.org/x/tools/go/analysis"
)
func init() {
register.Plugin("nilinterface", New)
}
func New(settings any) (register.LinterPlugin, error) {
return linterPlugin{}, nil
}
// linterPlugin implements the register.LinterPlugin interface for
// [analysis.Analyzer].
type linterPlugin struct{}
func (l linterPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {
return []*analysis.Analyzer{analyzer.Analyzer}, nil
}
func (l linterPlugin) GetLoadMode() string {
return register.LoadModeTypesInfo
}