Skip to content

ParseStandard not validating step range #543

Open

Description

@alyush1n

Try ParseStandard("*/90 * * * *"). Job will be executed every 1 hour.
Expected some validation error like: step range (90) above maximum (59): 90

Activity

  1. added 3 commits that reference this issue on Nov 25, 2025
    edbdfe4
    d45e189
    c17be23
  2. CybotTM commented on Dec 4, 2025

    @CybotTM

    Solution available in maintained fork

    This feature has been implemented in netresearch/go-cron, a maintained fork of this library.

    Implementation: Step range validation now ensures step size is less than range size. For example:

    // Now returns error (step >= range size)
    _, err := cron.ParseStandard("*/60 * * * *")
    // Error: step (60) must be less than range size (60)
    
    // Valid step ranges still work
    _, err := cron.ParseStandard("*/15 * * * *") // Every 15 minutes - OK
    

    How to migrate:

    // Change import from:
    import "github.com/robfig/cron/v3"
    
    // To:
    import cron "github.com/netresearch/go-cron"
    

    The API is 100% backward compatible. See the migration guide for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions