gorhill / cronexpr

Cron expression parser in Go language (golang)
683 stars 168 forks source link

Add a func to validate whether a cron expression is valid #3

Closed gorhill closed 11 years ago

gorhill commented 11 years ago

For convenience, developer might want to check whether an externally supplied cron expression is valid given the currently supported cron syntax.

This func will not be called automatically internally at the entry point CronExpression.NextTime(), the choice will be left to the developer as to whether he/she wants to incur the overhead cost of validation.

gorhill commented 11 years ago

cronexpr.Parse() now return an error if the cron time expression is not valid. Printing the error gives further details about where the error occur.