MCPcopy Index your code
hub / github.com/coder/coder / validateTimeRangeSpec

Function validateTimeRangeSpec

coderd/schedule/cron/cron.go:309–321  ·  view source on GitHub ↗

validateTimeRangeSpec ensures that the minutes field is set to *

(spec string)

Source from the content-addressed store, hash-verified

307
308// validateTimeRangeSpec ensures that the minutes field is set to *
309func validateTimeRangeSpec(spec string) error {
310 parts := strings.Fields(spec)
311 if len(parts) < 5 {
312 return xerrors.Errorf("expected schedule to consist of 5 fields with an optional CRON_TZ=<timezone> prefix")
313 }
314 if len(parts) == 6 {
315 parts = parts[1:]
316 }
317 if parts[0] != "*" {
318 return xerrors.Errorf("expected minutes to be *")
319 }
320 return nil
321}

Callers 1

TimeRangeFunction · 0.85

Calls 2

FieldsMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected