blob: e2e51d31010f99c91bf4f57163a818a2dbc06ebe [file] [log] [blame] [edit]
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package assets
import (
"fmt"
"regexp"
)
var versionRegexp = regexp.MustCompile(`v\d+\.\d+\.\d+`)
func ValidateVersion(version string) error {
if !versionRegexp.MatchString(version) {
return fmt.Errorf("version must be of the form 'v1.2.3'")
}
return nil
}
func ToCIPDVersion(version string) string {
return version[1:]
}