File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ func main() {
22
22
info := createBuildInfo ()
23
23
24
24
if err := commands .Execute (info ); err != nil {
25
- _ , _ = fmt .Fprintf (os .Stderr , "failed executing command with error %v\n " , err )
25
+ _ , _ = fmt .Fprintf (os .Stderr , "Failed executing command with error: %v\n " , err )
26
26
os .Exit (exitcodes .Failure )
27
27
}
28
28
}
Original file line number Diff line number Diff line change 1
1
package commands
2
2
3
3
import (
4
- "context"
5
4
"fmt"
6
5
"log"
7
6
"os"
@@ -27,7 +26,7 @@ func newCustomCommand(logger logutils.Log) *customCommand {
27
26
28
27
customCmd := & cobra.Command {
29
28
Use : "custom" ,
30
- Short : "Build a version of golangci-lint with custom linters. " ,
29
+ Short : "Build a version of golangci-lint with custom linters" ,
31
30
Args : cobra .NoArgs ,
32
31
PreRunE : c .preRunE ,
33
32
RunE : c .runE ,
@@ -54,9 +53,7 @@ func (c *customCommand) preRunE(_ *cobra.Command, _ []string) error {
54
53
return nil
55
54
}
56
55
57
- func (c * customCommand ) runE (_ * cobra.Command , _ []string ) error {
58
- ctx := context .Background ()
59
-
56
+ func (c * customCommand ) runE (cmd * cobra.Command , _ []string ) error {
60
57
tmp , err := os .MkdirTemp (os .TempDir (), "custom-gcl" )
61
58
if err != nil {
62
59
return fmt .Errorf ("create temporary directory: %w" , err )
@@ -72,7 +69,7 @@ func (c *customCommand) runE(_ *cobra.Command, _ []string) error {
72
69
_ = os .RemoveAll (tmp )
73
70
}()
74
71
75
- err = internal .NewBuilder (c .log , c .cfg , tmp ).Build (ctx )
72
+ err = internal .NewBuilder (c .log , c .cfg , tmp ).Build (cmd . Context () )
76
73
if err != nil {
77
74
return fmt .Errorf ("build process: %w" , err )
78
75
}
You can’t perform that action at this time.
0 commit comments