@@ -27,9 +27,11 @@ import (
27
27
func getDefaultExcludeHelp () string {
28
28
parts := []string {"Use or not use default excludes:" }
29
29
for _ , ep := range config .DefaultExcludePatterns {
30
- parts = append (parts , fmt .Sprintf (" # %s: %s" , ep .Linter , ep .Why ))
31
- parts = append (parts , fmt .Sprintf (" - %s" , color .YellowString (ep .Pattern )))
32
- parts = append (parts , "" )
30
+ parts = append (parts ,
31
+ fmt .Sprintf (" # %s: %s" , ep .Linter , ep .Why ),
32
+ fmt .Sprintf (" - %s" , color .YellowString (ep .Pattern )),
33
+ "" ,
34
+ )
33
35
}
34
36
return strings .Join (parts , "\n " )
35
37
}
@@ -184,7 +186,7 @@ func (e *Executor) initRunConfiguration(cmd *cobra.Command) {
184
186
initFlagSet (fs , e .cfg , e .DBManager , true )
185
187
}
186
188
187
- func (e Executor ) getConfigForCommandLine () (* config.Config , error ) {
189
+ func (e * Executor ) getConfigForCommandLine () (* config.Config , error ) {
188
190
// We use another pflag.FlagSet here to not set `changed` flag
189
191
// on cmd.Flags() options. Otherwise string slice options will be duplicated.
190
192
fs := pflag .NewFlagSet ("config flag set" , pflag .ContinueOnError )
@@ -412,10 +414,10 @@ func (e *Executor) setupExitCode(ctx context.Context) {
412
414
}
413
415
}
414
416
415
- func watchResources (ctx context.Context , done chan struct {}, log logutils.Log ) {
417
+ func watchResources (ctx context.Context , done chan struct {}, logger logutils.Log ) {
416
418
startedAt := time .Now ()
417
419
418
- rssValues := []uint64 {}
420
+ var rssValues []uint64
419
421
ticker := time .NewTicker (100 * time .Millisecond )
420
422
defer ticker .Stop ()
421
423
@@ -448,8 +450,8 @@ func watchResources(ctx context.Context, done chan struct{}, log logutils.Log) {
448
450
449
451
const MB = 1024 * 1024
450
452
maxMB := float64 (max ) / MB
451
- log .Infof ("Memory: %d samples, avg is %.1fMB, max is %.1fMB" ,
453
+ logger .Infof ("Memory: %d samples, avg is %.1fMB, max is %.1fMB" ,
452
454
len (rssValues ), float64 (avg )/ MB , maxMB )
453
- log .Infof ("Execution took %s" , time .Since (startedAt ))
455
+ logger .Infof ("Execution took %s" , time .Since (startedAt ))
454
456
close (done )
455
457
}
0 commit comments