1
0
mirror of https://github.com/golang/go synced 2024-11-26 15:06:52 -07:00

cmd/go: simplify some modfetch code

No point to s[:].

Change-Id: I9ba5483010180015555ecbed87c1ac82903fd9dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/175277
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2019-05-04 10:58:42 -07:00
parent 53374e7e06
commit 3e7e2546fc

View File

@ -62,9 +62,8 @@ func PseudoVersion(major, older string, t time.Time, rev string) string {
// Form (2), (3).
// Extract patch from vMAJOR.MINOR.PATCH
v := older[:]
i := strings.LastIndex(v, ".") + 1
v, patch := v[:i], v[i:]
i := strings.LastIndex(older, ".") + 1
v, patch := older[:i], older[i:]
// Increment PATCH by adding 1 to decimal:
// scan right to left turning 9s to 0s until you find a digit to increment.