@@ -18,18 +18,18 @@ type AnalyzerPlugin interface {
18
18
GetAnalyzers () []* analysis.Analyzer
19
19
}
20
20
21
- // PluginBuilder builds the custom linters (plugins ) based on the configuration.
22
- type PluginBuilder struct {
21
+ // PluginGoBuilder builds the custom linters (Go plugin ) based on the configuration.
22
+ type PluginGoBuilder struct {
23
23
log logutils.Log
24
24
}
25
25
26
- // NewPluginBuilder creates new PluginBuilder .
27
- func NewPluginBuilder (log logutils.Log ) * PluginBuilder {
28
- return & PluginBuilder {log : log }
26
+ // NewPluginGoBuilder creates new PluginGoBuilder .
27
+ func NewPluginGoBuilder (log logutils.Log ) * PluginGoBuilder {
28
+ return & PluginGoBuilder {log : log }
29
29
}
30
30
31
31
// Build loads custom linters that are specified in the golangci-lint config file.
32
- func (b * PluginBuilder ) Build (cfg * config.Config ) []* linter.Config {
32
+ func (b * PluginGoBuilder ) Build (cfg * config.Config ) []* linter.Config {
33
33
if cfg == nil || b .log == nil {
34
34
return nil
35
35
}
@@ -51,7 +51,7 @@ func (b *PluginBuilder) Build(cfg *config.Config) []*linter.Config {
51
51
52
52
// loadConfig loads the configuration of private linters.
53
53
// Private linters are dynamically loaded from .so plugin files.
54
- func (b * PluginBuilder ) loadConfig (cfg * config.Config , name string , settings * config.CustomLinterSettings ) (* linter.Config , error ) {
54
+ func (b * PluginGoBuilder ) loadConfig (cfg * config.Config , name string , settings * config.CustomLinterSettings ) (* linter.Config , error ) {
55
55
analyzers , err := b .getAnalyzerPlugin (cfg , settings .Path , settings .Settings )
56
56
if err != nil {
57
57
return nil , err
@@ -75,7 +75,7 @@ func (b *PluginBuilder) loadConfig(cfg *config.Config, name string, settings *co
75
75
// and returns the 'AnalyzerPlugin' interface implemented by the private plugin.
76
76
// An error is returned if the private linter cannot be loaded
77
77
// or the linter does not implement the AnalyzerPlugin interface.
78
- func (b * PluginBuilder ) getAnalyzerPlugin (cfg * config.Config , path string , settings any ) ([]* analysis.Analyzer , error ) {
78
+ func (b * PluginGoBuilder ) getAnalyzerPlugin (cfg * config.Config , path string , settings any ) ([]* analysis.Analyzer , error ) {
79
79
if ! filepath .IsAbs (path ) {
80
80
// resolve non-absolute paths relative to config file's directory
81
81
path = filepath .Join (cfg .GetConfigDir (), path )
@@ -94,7 +94,7 @@ func (b *PluginBuilder) getAnalyzerPlugin(cfg *config.Config, path string, setti
94
94
return analyzers , nil
95
95
}
96
96
97
- func (b * PluginBuilder ) lookupPlugin (plug * plugin.Plugin , settings any ) ([]* analysis.Analyzer , error ) {
97
+ func (b * PluginGoBuilder ) lookupPlugin (plug * plugin.Plugin , settings any ) ([]* analysis.Analyzer , error ) {
98
98
symbol , err := plug .Lookup ("New" )
99
99
if err != nil {
100
100
analyzers , errP := b .lookupAnalyzerPlugin (plug )
@@ -114,7 +114,7 @@ func (b *PluginBuilder) lookupPlugin(plug *plugin.Plugin, settings any) ([]*anal
114
114
return constructor (settings )
115
115
}
116
116
117
- func (b * PluginBuilder ) lookupAnalyzerPlugin (plug * plugin.Plugin ) ([]* analysis.Analyzer , error ) {
117
+ func (b * PluginGoBuilder ) lookupAnalyzerPlugin (plug * plugin.Plugin ) ([]* analysis.Analyzer , error ) {
118
118
symbol , err := plug .Lookup ("AnalyzerPlugin" )
119
119
if err != nil {
120
120
return nil , err
0 commit comments