Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pchila committed Jan 23, 2024
1 parent 358a2e6 commit d202cc9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dev-tools/mage/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -869,21 +869,21 @@ var parseVersionRegex = regexp.MustCompile(`(?m)^[^\d]*(?P<major>\d+)\.(?P<minor

// ParseVersion extracts the major, minor, and optional patch number from a
// version string.
func ParseVersion(version string) (major, minor, patch int, err error) {
func ParseVersion(version string) (int, int, int, error) {
names := parseVersionRegex.SubexpNames()
matches := parseVersionRegex.FindStringSubmatch(version)
if len(matches) == 0 {
err = fmt.Errorf("failed to parse version '%v'", version)
return
err := fmt.Errorf("failed to parse version '%v'", version)
return 0, 0, 0, err
}

data := map[string]string{}
for i, match := range matches {
data[names[i]] = match
}
major, _ = strconv.Atoi(data["major"])
minor, _ = strconv.Atoi(data["minor"])
patch, _ = strconv.Atoi(data["patch"])
major, _ := strconv.Atoi(data["major"])
minor, _ := strconv.Atoi(data["minor"])
patch, _ := strconv.Atoi(data["patch"])
return major, minor, patch, nil
}

Expand Down

0 comments on commit d202cc9

Please sign in to comment.