{"owner":"go-co-op","repo":"gocron","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":[".github/copilot-instructions.md"],"skills":{".github/copilot-instructions.md":"# gocron: Go Job Scheduling Library\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Bootstrap and Build Commands\n- Install dependencies: `go mod tidy`\n- Build the library: `go build -v ./...`\n- Install required tools:\n  - `go install go.uber.org/mock/mockgen@latest`\n  - `export PATH=$PATH:$(go env GOPATH)/bin` (add to shell profile)\n- Generate mocks: `make mocks`\n- Format code: `make fmt`\n\n### Testing Commands\n- Run all tests: `make test` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run CI tests: `make test_ci` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run with coverage: `make test_coverage` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run specific tests: `go test -v -race -count=1 ./...`\n\n### Linting Commands\n- Format verification: `grep \"^func [a-zA-Z]\" example_test.go | sort -c`\n- Full linting: `make lint` -- MAY FAIL due to golangci-lint config compatibility issues. This is a known issue.\n- Alternative basic linting: `go vet ./...` and `gofmt -d .`\n\n## Validation\n\n### Required Validation Steps\n- ALWAYS run `make test` before submitting changes. Tests must pass.\n- ALWAYS run `make fmt` to ensure proper formatting.\n- ALWAYS run `make mocks` if you change interface definitions.\n- ALWAYS verify examples still work by running them: `cd examples/elector && go run main.go`\n\n### Manual Testing Scenarios\nSince this is a library, not an application, testing involves:\n1. **Basic Scheduler Creation**: Verify you can create a scheduler with `gocron.NewScheduler()`\n2. **Job Creation**: Verify you can create jobs with various `JobDefinition` types\n3. **Scheduler Lifecycle**: Verify Start() and Shutdown() work correctly\n4. **Example Validation**: Run examples in `examples/` directory to ensure functionality\n\nExample validation script:\n```go\npackage main\nimport (\n    \"fmt\"\n    \"time\"\n    \"github.com/go-co-op/gocron/v2\"\n)\nfunc main() {\n    s, err := gocron.NewScheduler()\n    if err != nil { panic(err) }\n    j, err := s.NewJob(\n        gocron.DurationJob(2*time.Second),\n        gocron.NewTask(func() { fmt.Println(\"Working!\") }),\n    )\n    if err != nil { panic(err) }\n    fmt.Printf(\"Job ID: %s\\n\", j.ID())\n    s.Start()\n    time.Sleep(6 * time.Second)\n    s.Shutdown()\n}\n```\n\n### CI Requirements\nThe CI will fail if:\n- Tests don't pass (`make test_ci`)\n- Function order in `example_test.go` is incorrect\n- golangci-lint finds issues (though config compatibility varies)\n\n## Common Tasks\n\n### Repository Structure\n```\n.\n├── README.md              # Main documentation\n├── CONTRIBUTING.md        # Contribution guidelines\n├── SECURITY.md           # Security policy\n├── Makefile              # Build automation\n├── go.mod               # Go module definition\n├── .github/             # GitHub workflows and configs\n├── .golangci.yaml       # Linting configuration\n├── examples/            # Usage examples\n│   └── elector/         # Distributed elector example\n├── mocks/               # Generated mock files\n├── *.go                # Library source files\n└── *_test.go           # Test files\n```\n\n### Key Source Files\n- `scheduler.go` - Main scheduler implementation\n- `job.go` - Job definitions and scheduling logic\n- `executor.go` - Job execution engine\n- `logger.go` - Logging interfaces and implementations\n- `distributed.go` - Distributed scheduling support\n- `monitor.go` - Job monitoring interfaces\n- `util.go` - Utility functions\n- `errors.go` - Error definitions\n\n### Dependencies and Versions\n- Requires Go 1.23.0+ (CI matrix pins to `stable`/`oldstable` — see `.github/workflows/go_test.yml`)\n- Key dependencies automatically managed via `go mod`:\n  - `github.com/google/uuid` - UUID generation\n  - `github.com/jonboulle/clockwork` - Time mocking for tests\n  - `github.com/robfig/cron/v3` - Cron expression parsing\n  - `github.com/stretchr/testify` - Testing utilities\n  - `go.uber.org/goleak` - Goroutine leak detection\n\n### Testing Patterns\n- Uses table-driven tests following Go best practices\n- Extensive use of goroutine leak detection (may be skipped in CI via TEST_ENV)\n- Mock-based testing for interfaces\n- Race condition detection enabled (`-race` flag)\n- 93.8% test coverage expected\n\n### Build and Release\n- No application to build - this is a library\n- Version managed via Git tags (v2.x.x)\n- Distribution via Go module system\n- CI tests on Go `stable` and `oldstable` (see `.github/workflows/go_test.yml`)\n\n## Troubleshooting\n\n### Common Issues\n1. **mockgen not found**: Install with `go install go.uber.org/mock/mockgen@latest`\n2. **golangci-lint config errors**: Known compatibility issue - use `go vet` instead\n3. **Test timeouts**: Tests can take 50+ seconds, always set adequate timeouts\n4. **PATH issues**: Ensure `$(go env GOPATH)/bin` is in PATH\n5. **Import errors in examples**: Run `go mod tidy` to resolve dependencies\n\n### Expected Timings\n- `make test`: ~50 seconds\n- `make test_coverage`: ~50 seconds\n- `make test_ci`: ~50 seconds\n- `go build`: ~5 seconds\n- `make mocks`: ~2 seconds\n- `make fmt`: <1 second\n\n### Known Limitations\n- golangci-lint configuration may have compatibility issues with certain versions\n- Some tests are skipped in CI environments (controlled by TEST_ENV variable)\n- Examples directory has no tests but should be manually validated\n"},"files":{".github/copilot-instructions.md":"# gocron: Go Job Scheduling Library\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Bootstrap and Build Commands\n- Install dependencies: `go mod tidy`\n- Build the library: `go build -v ./...`\n- Install required tools:\n  - `go install go.uber.org/mock/mockgen@latest`\n  - `export PATH=$PATH:$(go env GOPATH)/bin` (add to shell profile)\n- Generate mocks: `make mocks`\n- Format code: `make fmt`\n\n### Testing Commands\n- Run all tests: `make test` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run CI tests: `make test_ci` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run with coverage: `make test_coverage` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run specific tests: `go test -v -race -count=1 ./...`\n\n### Linting Commands\n- Format verification: `grep \"^func [a-zA-Z]\" example_test.go | sort -c`\n- Full linting: `make lint` -- MAY FAIL due to golangci-lint config compatibility issues. This is a known issue.\n- Alternative basic linting: `go vet ./...` and `gofmt -d .`\n\n## Validation\n\n### Required Validation Steps\n- ALWAYS run `make test` before submitting changes. Tests must pass.\n- ALWAYS run `make fmt` to ensure proper formatting.\n- ALWAYS run `make mocks` if you change interface definitions.\n- ALWAYS verify examples still work by running them: `cd examples/elector && go run main.go`\n\n### Manual Testing Scenarios\nSince this is a library, not an application, testing involves:\n1. **Basic Scheduler Creation**: Verify you can create a scheduler with `gocron.NewScheduler()`\n2. **Job Creation**: Verify you can create jobs with various `JobDefinition` types\n3. **Scheduler Lifecycle**: Verify Start() and Shutdown() work correctly\n4. **Example Validation**: Run examples in `examples/` directory to ensure functionality\n\nExample validation script:\n```go\npackage main\nimport (\n    \"fmt\"\n    \"time\"\n    \"github.com/go-co-op/gocron/v2\"\n)\nfunc main() {\n    s, err := gocron.NewScheduler()\n    if err != nil { panic(err) }\n    j, err := s.NewJob(\n        gocron.DurationJob(2*time.Second),\n        gocron.NewTask(func() { fmt.Println(\"Working!\") }),\n    )\n    if err != nil { panic(err) }\n    fmt.Printf(\"Job ID: %s\\n\", j.ID())\n    s.Start()\n    time.Sleep(6 * time.Second)\n    s.Shutdown()\n}\n```\n\n### CI Requirements\nThe CI will fail if:\n- Tests don't pass (`make test_ci`)\n- Function order in `example_test.go` is incorrect\n- golangci-lint finds issues (though config compatibility varies)\n\n## Common Tasks\n\n### Repository Structure\n```\n.\n├── README.md              # Main documentation\n├── CONTRIBUTING.md        # Contribution guidelines\n├── SECURITY.md           # Security policy\n├── Makefile              # Build automation\n├── go.mod               # Go module definition\n├── .github/             # GitHub workflows and configs\n├── .golangci.yaml       # Linting configuration\n├── examples/            # Usage examples\n│   └── elector/         # Distributed elector example\n├── mocks/               # Generated mock files\n├── *.go                # Library source files\n└── *_test.go           # Test files\n```\n\n### Key Source Files\n- `scheduler.go` - Main scheduler implementation\n- `job.go` - Job definitions and scheduling logic\n- `executor.go` - Job execution engine\n- `logger.go` - Logging interfaces and implementations\n- `distributed.go` - Distributed scheduling support\n- `monitor.go` - Job monitoring interfaces\n- `util.go` - Utility functions\n- `errors.go` - Error definitions\n\n### Dependencies and Versions\n- Requires Go 1.23.0+ (CI matrix pins to `stable`/`oldstable` — see `.github/workflows/go_test.yml`)\n- Key dependencies automatically managed via `go mod`:\n  - `github.com/google/uuid` - UUID generation\n  - `github.com/jonboulle/clockwork` - Time mocking for tests\n  - `github.com/robfig/cron/v3` - Cron expression parsing\n  - `github.com/stretchr/testify` - Testing utilities\n  - `go.uber.org/goleak` - Goroutine leak detection\n\n### Testing Patterns\n- Uses table-driven tests following Go best practices\n- Extensive use of goroutine leak detection (may be skipped in CI via TEST_ENV)\n- Mock-based testing for interfaces\n- Race condition detection enabled (`-race` flag)\n- 93.8% test coverage expected\n\n### Build and Release\n- No application to build - this is a library\n- Version managed via Git tags (v2.x.x)\n- Distribution via Go module system\n- CI tests on Go `stable` and `oldstable` (see `.github/workflows/go_test.yml`)\n\n## Troubleshooting\n\n### Common Issues\n1. **mockgen not found**: Install with `go install go.uber.org/mock/mockgen@latest`\n2. **golangci-lint config errors**: Known compatibility issue - use `go vet` instead\n3. **Test timeouts**: Tests can take 50+ seconds, always set adequate timeouts\n4. **PATH issues**: Ensure `$(go env GOPATH)/bin` is in PATH\n5. **Import errors in examples**: Run `go mod tidy` to resolve dependencies\n\n### Expected Timings\n- `make test`: ~50 seconds\n- `make test_coverage`: ~50 seconds\n- `make test_ci`: ~50 seconds\n- `go build`: ~5 seconds\n- `make mocks`: ~2 seconds\n- `make fmt`: <1 second\n\n### Known Limitations\n- golangci-lint configuration may have compatibility issues with certain versions\n- Some tests are skipped in CI environments (controlled by TEST_ENV variable)\n- Examples directory has no tests but should be manually validated\n"},"items":[{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","title":"copilot-instructions.md","content":"# gocron: Go Job Scheduling Library\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Bootstrap and Build Commands\n- Install dependencies: `go mod tidy`\n- Build the library: `go build -v ./...`\n- Install required tools:\n  - `go install go.uber.org/mock/mockgen@latest`\n  - `export PATH=$PATH:$(go env GOPATH)/bin` (add to shell profile)\n- Generate mocks: `make mocks`\n- Format code: `make fmt`\n\n### Testing Commands\n- Run all tests: `make test` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run CI tests: `make test_ci` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run with coverage: `make test_coverage` -- takes 50 seconds. NEVER CANCEL. Set timeout to 90+ seconds.\n- Run specific tests: `go test -v -race -count=1 ./...`\n\n### Linting Commands\n- Format verification: `grep \"^func [a-zA-Z]\" example_test.go | sort -c`\n- Full linting: `make lint` -- MAY FAIL due to golangci-lint config compatibility issues. This is a known issue.\n- Alternative basic linting: `go vet ./...` and `gofmt -d .`\n\n## Validation\n\n### Required Validation Steps\n- ALWAYS run `make test` before submitting changes. Tests must pass.\n- ALWAYS run `make fmt` to ensure proper formatting.\n- ALWAYS run `make mocks` if you change interface definitions.\n- ALWAYS verify examples still work by running them: `cd examples/elector && go run main.go`\n\n### Manual Testing Scenarios\nSince this is a library, not an application, testing involves:\n1. **Basic Scheduler Creation**: Verify you can create a scheduler with `gocron.NewScheduler()`\n2. **Job Creation**: Verify you can create jobs with various `JobDefinition` types\n3. **Scheduler Lifecycle**: Verify Start() and Shutdown() work correctly\n4. **Example Validation**: Run examples in `examples/` directory to ensure functionality\n\nExample validation script:\n```go\npackage main\nimport (\n    \"fmt\"\n    \"time\"\n    \"github.com/go-co-op/gocron/v2\"\n)\nfunc main() {\n    s, err := gocron.NewScheduler()\n    if err != nil { panic(err) }\n    j, err := s.NewJob(\n        gocron.DurationJob(2*time.Second),\n        gocron.NewTask(func() { fmt.Println(\"Working!\") }),\n    )\n    if err != nil { panic(err) }\n    fmt.Printf(\"Job ID: %s\\n\", j.ID())\n    s.Start()\n    time.Sleep(6 * time.Second)\n    s.Shutdown()\n}\n```\n\n### CI Requirements\nThe CI will fail if:\n- Tests don't pass (`make test_ci`)\n- Function order in `example_test.go` is incorrect\n- golangci-lint finds issues (though config compatibility varies)\n\n## Common Tasks\n\n### Repository Structure\n```\n.\n├── README.md              # Main documentation\n├── CONTRIBUTING.md        # Contribution guidelines\n├── SECURITY.md           # Security policy\n├── Makefile              # Build automation\n├── go.mod               # Go module definition\n├── .github/             # GitHub workflows and configs\n├── .golangci.yaml       # Linting configuration\n├── examples/            # Usage examples\n│   └── elector/         # Distributed elector example\n├── mocks/               # Generated mock files\n├── *.go                # Library source files\n└── *_test.go           # Test files\n```\n\n### Key Source Files\n- `scheduler.go` - Main scheduler implementation\n- `job.go` - Job definitions and scheduling logic\n- `executor.go` - Job execution engine\n- `logger.go` - Logging interfaces and implementations\n- `distributed.go` - Distributed scheduling support\n- `monitor.go` - Job monitoring interfaces\n- `util.go` - Utility functions\n- `errors.go` - Error definitions\n\n### Dependencies and Versions\n- Requires Go 1.23.0+ (CI matrix pins to `stable`/`oldstable` — see `.github/workflows/go_test.yml`)\n- Key dependencies automatically managed via `go mod`:\n  - `github.com/google/uuid` - UUID generation\n  - `github.com/jonboulle/clockwork` - Time mocking for tests\n  - `github.com/robfig/cron/v3` - Cron expression parsing\n  - `github.com/stretchr/testify` - Testing utilities\n  - `go.uber.org/goleak` - Goroutine leak detection\n\n### Testing Patterns\n- Uses table-driven tests following Go best practices\n- Extensive use of goroutine leak detection (may be skipped in CI via TEST_ENV)\n- Mock-based testing for interfaces\n- Race condition detection enabled (`-race` flag)\n- 93.8% test coverage expected\n\n### Build and Release\n- No application to build - this is a library\n- Version managed via Git tags (v2.x.x)\n- Distribution via Go module system\n- CI tests on Go `stable` and `oldstable` (see `.github/workflows/go_test.yml`)\n\n## Troubleshooting\n\n### Common Issues\n1. **mockgen not found**: Install with `go install go.uber.org/mock/mockgen@latest`\n2. **golangci-lint config errors**: Known compatibility issue - use `go vet` instead\n3. **Test timeouts**: Tests can take 50+ seconds, always set adequate timeouts\n4. **PATH issues**: Ensure `$(go env GOPATH)/bin` is in PATH\n5. **Import errors in examples**: Run `go mod tidy` to resolve dependencies\n\n### Expected Timings\n- `make test`: ~50 seconds\n- `make test_coverage`: ~50 seconds\n- `make test_ci`: ~50 seconds\n- `go build`: ~5 seconds\n- `make mocks`: ~2 seconds\n- `make fmt`: <1 second\n\n### Known Limitations\n- golangci-lint configuration may have compatibility issues with certain versions\n- Some tests are skipped in CI environments (controlled by TEST_ENV variable)\n- Examples directory has no tests but should be manually validated\n","category":".github","tokens":1357}]}