Commit 3e7e2546 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/go: simplify some modfetch code

No point to s[:].

Change-Id: I9ba5483010180015555ecbed87c1ac82903fd9dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/175277Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 53374e7e
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment