File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -132,5 +132,10 @@ func (ver semVer) MajorMinor() SemVer {
132132}
133133
134134func (ver semVer ) StandardSemVer () string {
135- return string (ver )[1 :]
135+ // Drop the 'v' prefix from the version string.
136+ result := string (ver )[1 :]
137+
138+ // Correct the pre-release identifier for use with `setup-go`, if one is present.
139+ // This still remains a standard semantic version.
140+ return strings .Replace (result , "-rc" , "-rc." , 1 )
136141}
Original file line number Diff line number Diff line change 11package util
22
33import (
4+ "strings"
45 "testing"
56
67 "golang.org/x/mod/semver"
@@ -52,6 +53,8 @@ func TestNewSemVer(t *testing.T) {
5253 result ,
5354 )
5455 }
56+
57+ expected = strings .Replace (expected , "-rc1" , "-rc.1" , 1 )
5558 if result .StandardSemVer () != expected [1 :] {
5659 t .Errorf (
5760 "Expected NewSemVer(\" %s\" ).StandardSemVer() to return \" %s\" , but got \" %s\" ." ,
You can’t perform that action at this time.
0 commit comments