Skip to content

[Bug]: Cron validator #1529

@kyungjun-pe

Description

@kyungjun-pe

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions