File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -44,35 +44,32 @@ func WithOptions(options ...Option) *Config {
44
44
45
45
func WithIgnoredFunctions (excludes string ) Option {
46
46
return func (config * Config ) {
47
- if excludes == "" {
48
- return
49
- }
50
-
51
47
for _ , exclude := range strings .Split (excludes , "," ) {
48
+ if exclude == "" {
49
+ continue
50
+ }
52
51
config .IgnoredFunctions = append (config .IgnoredFunctions , regexp .MustCompile (exclude ))
53
52
}
54
53
}
55
54
}
56
55
57
56
func WithIgnoredFiles (excludes string ) Option {
58
57
return func (config * Config ) {
59
- if excludes == "" {
60
- return
61
- }
62
-
63
58
for _ , exclude := range strings .Split (excludes , "," ) {
59
+ if exclude == "" {
60
+ continue
61
+ }
64
62
config .IgnoredFiles = append (config .IgnoredFiles , regexp .MustCompile (exclude ))
65
63
}
66
64
}
67
65
}
68
66
69
67
func WithIgnoredNumbers (numbers string ) Option {
70
68
return func (config * Config ) {
71
- if numbers == "" {
72
- return
73
- }
74
-
75
69
for _ , number := range strings .Split (numbers , "," ) {
70
+ if number == "" {
71
+ continue
72
+ }
76
73
config .IgnoredNumbers [config .removeDigitSeparator (number )] = struct {}{}
77
74
}
78
75
}
@@ -89,6 +86,9 @@ func WithCustomChecks(checks string) Option {
89
86
}
90
87
91
88
for _ , name := range strings .Split (checks , "," ) {
89
+ if name == "" {
90
+ continue
91
+ }
92
92
config .Checks [name ] = true
93
93
}
94
94
}
You can’t perform that action at this time.
0 commit comments