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 44	"cmp" 
55	"fmt" 
66	"os" 
7+ 	"regexp" 
78	"runtime/debug" 
9+ 	"strings" 
810
911	"github.com/golangci/golangci-lint/v2/pkg/commands" 
1012	"github.com/golangci/golangci-lint/v2/pkg/exitcodes" 
@@ -23,7 +25,7 @@ func main() {
2325	info  :=  createBuildInfo ()
2426
2527	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 )
2729		os .Exit (exitcodes .Failure )
2830	}
2931}
@@ -49,6 +51,11 @@ func createBuildInfo() commands.BuildInfo {
4951
5052	info .Version  =  buildInfo .Main .Version 
5153
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+ 
5259	var  revision  string 
5360	var  modified  string 
5461	for  _ , setting  :=  range  buildInfo .Settings  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments