From: Russ Cox Date: Tue, 13 Nov 2018 15:15:02 +0000 (+0000) Subject: cmd/go: revert "remove unnecessary else conditions" X-Git-Tag: go1.12beta1~373 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8f7173dcdeb1a1c8af885bb2a267674b4f5fbfc4;p=gostls13.git cmd/go: revert "remove unnecessary else conditions" This reverts CL 144137. Reason for revert: The justification for the original commit was that golint said so, but golint is wrong. The code reads more clearly the original way. Change-Id: I960f286ed66fec67aabd953e7b69993f60b00bca Reviewed-on: https://go-review.googlesource.com/c/149339 Reviewed-by: Russ Cox --- diff --git a/src/cmd/go/internal/semver/semver.go b/src/cmd/go/internal/semver/semver.go index d61c6b476a..4af7118e55 100644 --- a/src/cmd/go/internal/semver/semver.go +++ b/src/cmd/go/internal/semver/semver.go @@ -312,8 +312,9 @@ func compareInt(x, y string) int { } if x < y { return -1 + } else { + return +1 } - return +1 } func comparePrerelease(x, y string) int { @@ -352,8 +353,9 @@ func comparePrerelease(x, y string) int { if ix != iy { if ix { return -1 + } else { + return +1 } - return +1 } if ix { if len(dx) < len(dy) { @@ -365,14 +367,16 @@ func comparePrerelease(x, y string) int { } if dx < dy { return -1 + } else { + return +1 } - return +1 } } if x == "" { return -1 + } else { + return +1 } - return +1 } func nextIdent(x string) (dx, rest string) {