Contributing to go-cron
February 25, 2026 ยท View on GitHub
Thank you for your interest in contributing to go-cron! This document provides guidelines and information for contributors.
Code of Conduct
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
How to Contribute
Reporting Bugs
Before creating a bug report:
- Check the existing issues to avoid duplicates
- Ensure you're using the latest version
- Collect relevant information (Go version, OS, stack traces)
When creating a bug report, include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs. actual behavior
- Code samples or test cases if applicable
- Environment details (Go version, OS)
Suggesting Enhancements
Enhancement suggestions are welcome! Please:
- Check existing issues and PRs first
- Clearly describe the use case
- Explain why existing functionality doesn't suffice
- Consider backwards compatibility
Pull Requests
- Fork and clone the repository
- Create a branch from
main:git checkout -b feature/your-feature-name - Make your changes following the coding standards below
- Write or update tests for your changes
- Run the test suite:
make test - Run linting:
make lint - Commit with conventional commits:
git commit -m "feat: add new scheduling option" - Push and create a PR against
main
Development Setup
Prerequisites
- Go 1.25 or later
- golangci-lint (for linting)
- make (for build automation)
Getting Started
# Clone your fork
git clone https://github.com/YOUR_USERNAME/go-cron.git
cd go-cron
# Install dependencies
go mod download
# Run tests
make test
# Run linter
make lint
Coding Standards
Go Style
- Follow Effective Go guidelines
- Use
gofmtandgoimportsfor formatting - Follow existing code patterns in the repository
Commit Messages
Use Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, no code changerefactor: Code restructuringtest: Adding/updating testschore: Maintenance tasks
Examples:
feat(parser): add support for custom timezone formats
fix(scheduler): handle DST transitions correctly
docs: update README with new examples
Developer Certificate of Origin (DCO)
This project requires all contributions to be signed off under the Developer Certificate of Origin (DCO). The DCO is a lightweight agreement that certifies you wrote or have the right to submit the code you are contributing.
Every commit must contain a Signed-off-by trailer matching the commit author,
for example:
feat(parser): add timezone alias support
Signed-off-by: Jane Doe <jane@example.com>
Add it automatically by passing -s (or --signoff) to git commit:
git commit -s -m "feat(parser): add timezone alias support"
The project's lefthook git hooks
will automatically add the Signed-off-by trailer via a prepare-commit-msg
hook and verify its presence in the commit-msg hook. If you prefer not to use
lefthook, please remember to sign off manually.
If you have already made commits without the sign-off, you can amend them:
# Amend the last commit
git commit --amend -s --no-edit
# Rebase and sign off all commits on your branch
git rebase --signoff main
Testing
- Write tests for new functionality
- Maintain or improve code coverage (minimum 70%)
- Test edge cases, especially:
- Timezone handling
- DST transitions
- Panic recovery
- Concurrent access
Run tests with:
# Unit tests
make test
# With race detection
go test -race ./...
# With coverage
make test-coverage
Documentation
- Document exported functions, types, and methods
- Update README for user-facing changes
- Include examples for new features
Review Process
- All PRs require at least one approval
- CI must pass (tests, linting, security scans)
- Coverage must not decrease significantly
- Breaking changes need discussion first
API Compatibility
This library maintains backwards compatibility with robfig/cron/v3. When making changes:
- Don't remove or rename exported identifiers
- Don't change function signatures incompatibly
- Add new functionality via new functions/options
- Document any behavioral changes
Questions?
- Open a discussion for questions
- Check existing issues for similar topics
- Review the documentation
License
By contributing, you agree that your contributions will be licensed under the MIT License.