MCPcopy
hub / github.com/robfig/cron / parseIntOrName

Function parseIntOrName

parser.go:321–328  ·  view source on GitHub ↗

parseIntOrName returns the (possibly-named) integer contained in expr.

(expr string, names map[string]uint)

Source from the content-addressed store, hash-verified

319
320// parseIntOrName returns the (possibly-named) integer contained in expr.
321func parseIntOrName(expr string, names map[string]uint) (uint, error) {
322 if names != nil {
323 if namedInt, ok := names[strings.ToLower(expr)]; ok {
324 return namedInt, nil
325 }
326 }
327 return mustParseInt(expr)
328}
329
330// mustParseInt parses the given expression as an int or returns an error.
331func mustParseInt(expr string) (uint, error) {

Callers 1

getRangeFunction · 0.85

Calls 1

mustParseIntFunction · 0.85

Tested by

no test coverage detected