[Bug]: Cron validator
Author: kyungjun-peCreated Feb 10, 2026Updated Feb 10, 2026
Labelsbug
What happened?
Hello.
I was testing cron expressions using this library.
I encountered an error with the following schedules, which are semantically equivalent:
The schedule 10 0-3,9-23 * * * is correct.
The schedule 10 9-23,0-3 * * * is incorrect.
I don't understand why this library is generating this error.
I'm also curious if it's intentional.
Version
v10
Example Code
type CronStruct struct {
Cron string `validate:"cron"`
}
err = Valid.Struct(CronStruct)Source: go-playground/validator