File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 4
4
"cmp"
5
5
"fmt"
6
6
"os"
7
+ "regexp"
7
8
"runtime/debug"
9
+ "strings"
8
10
9
11
"github.com/golangci/golangci-lint/v2/pkg/commands"
10
12
"github.com/golangci/golangci-lint/v2/pkg/exitcodes"
@@ -23,7 +25,7 @@ func main() {
23
25
info := createBuildInfo ()
24
26
25
27
if err := commands .Execute (info ); err != nil {
26
- _ , _ = fmt .Fprintf (os .Stderr , "Failed executing command with error: %v\n " , err )
28
+ _ , _ = fmt .Fprintf (os .Stderr , "The command is terminated due to an error: %v\n " , err )
27
29
os .Exit (exitcodes .Failure )
28
30
}
29
31
}
@@ -49,6 +51,11 @@ func createBuildInfo() commands.BuildInfo {
49
51
50
52
info .Version = buildInfo .Main .Version
51
53
54
+ matched , _ := regexp .MatchString (`v\d+\.\d+\.\d+` , buildInfo .Main .Version )
55
+ if matched {
56
+ info .Version = strings .TrimPrefix (buildInfo .Main .Version , "v" )
57
+ }
58
+
52
59
var revision string
53
60
var modified string
54
61
for _ , setting := range buildInfo .Settings {
You can’t perform that action at this time.
0 commit comments