Skip to content

Commit 39de109

Browse files
committed
fix lint errors
1 parent b7f5e76 commit 39de109

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dev-tools/mage/common.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -869,21 +869,21 @@ var parseVersionRegex = regexp.MustCompile(`(?m)^[^\d]*(?P<major>\d+)\.(?P<minor
869869

870870
// ParseVersion extracts the major, minor, and optional patch number from a
871871
// version string.
872-
func ParseVersion(version string) (major, minor, patch int, err error) {
872+
func ParseVersion(version string) (int, int, int, error) {
873873
names := parseVersionRegex.SubexpNames()
874874
matches := parseVersionRegex.FindStringSubmatch(version)
875875
if len(matches) == 0 {
876-
err = fmt.Errorf("failed to parse version '%v'", version)
877-
return
876+
err := fmt.Errorf("failed to parse version '%v'", version)
877+
return 0, 0, 0, err
878878
}
879879

880880
data := map[string]string{}
881881
for i, match := range matches {
882882
data[names[i]] = match
883883
}
884-
major, _ = strconv.Atoi(data["major"])
885-
minor, _ = strconv.Atoi(data["minor"])
886-
patch, _ = strconv.Atoi(data["patch"])
884+
major, _ := strconv.Atoi(data["major"])
885+
minor, _ := strconv.Atoi(data["minor"])
886+
patch, _ := strconv.Atoi(data["patch"])
887887
return major, minor, patch, nil
888888
}
889889

0 commit comments

Comments
 (0)