Per https://semver.org/#spec-item-10, build metadata may include
a series of dot separated identifiers.
Fixes #28647
Change-Id: I98655c62584a822953df71fba32b4a2cafe7a04b
Reviewed-on: https://go-review.googlesource.com/c/148835
Reviewed-by: Bryan C. Mills <bcmills@google.com>
i := 1
start := 1
for i < len(v) {
- if !isIdentChar(v[i]) {
+ if !isIdentChar(v[i]) && v[i] != '.' {
return
}
if v[i] == '.' {
{"v1.2.3", "v1.2.3"},
{"v1.2.3+meta", "v1.2.3"},
{"v1.2.3+meta-pre", "v1.2.3"},
+ {"v1.2.3+meta-pre.sha.256a", "v1.2.3"},
}
func TestIsValid(t *testing.T) {