Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmd/golangci-lint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"cmp"
"fmt"
"os"
"regexp"
"runtime/debug"
"strings"

"github.com/golangci/golangci-lint/v2/pkg/commands"
"github.com/golangci/golangci-lint/v2/pkg/exitcodes"
Expand All @@ -23,7 +25,7 @@ func main() {
info := createBuildInfo()

if err := commands.Execute(info); err != nil {
_, _ = fmt.Fprintf(os.Stderr, "Failed executing command with error: %v\n", err)
_, _ = fmt.Fprintf(os.Stderr, "The command is terminated due to an error: %v\n", err)
os.Exit(exitcodes.Failure)
}
}
Expand All @@ -49,6 +51,11 @@ func createBuildInfo() commands.BuildInfo {

info.Version = buildInfo.Main.Version

matched, _ := regexp.MatchString(`v\d+\.\d+\.\d+`, buildInfo.Main.Version)
if matched {
info.Version = strings.TrimPrefix(buildInfo.Main.Version, "v")
}

var revision string
var modified string
for _, setting := range buildInfo.Settings {
Expand Down
Loading