MCPcopy Index your code
hub / github.com/bytebase/bytebase / parseCloudVersionDate

Function parseCloudVersionDate

action/command/root.go:239–253  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

237}
238
239func parseCloudVersionDate(version string) (time.Time, error) {
240 if len(version) != len("cloud-YYYYMMDD") || !strings.HasPrefix(version, cloudVersionPrefix) {
241 return time.Time{}, errors.Errorf("expected cloud-YYYYMMDD")
242 }
243 for _, r := range strings.TrimPrefix(version, cloudVersionPrefix) {
244 if r < '0' || r > '9' {
245 return time.Time{}, errors.Errorf("expected cloud-YYYYMMDD")
246 }
247 }
248 t, err := time.Parse("20060102", strings.TrimPrefix(version, cloudVersionPrefix))
249 if err != nil {
250 return time.Time{}, err
251 }
252 return t, nil
253}
254
255func parseReleaseMajorMinor(version string) (int, int, error) {
256 parts := strings.Split(version, ".")

Callers 1

parseVersionFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected