Thank you for your interest in contributing to pkg! This repository is a collection of low-level, dependency-free (mostly), high-performance Go packages designed for maximum efficiency, zero allocations where possible, and clean, idiomatic APIs. We aim to maintain production-grade quality with strong guarantees on stability and code quality.
Contributions are welcome, whether it's reporting bugs, suggesting features, fixing issues, or adding new packages. All contributions help make this toolkit better for the Go community.
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
We encourage pull requests for bug fixes, features, documentation improvements, or new packages. Follow these steps:
-
Fork the Repository: Create your own fork of the repo.
-
Create a Branch: Branch names must follow the format
<package>/<type>/<description>, where:<package>is the affected package (e.g.,utils,concurrency,sync).<type>is the change type (e.g.,feature,fix,docs,test).<description>is a short, descriptive name (use hyphens for spaces).
Examples:
utils/feature/add-new-string-utilconcurrency/fix/deadlock-in-semaphoresync/docs/update-mutex-usageutils/feature/PKG-123
-
Make Changes:
- Ensure your code aligns with the project's goals: low-level, high-performance, minimal dependencies (prefer standard library).
- APIs should be idiomatic, efficient, and minimal.
- Add or update tests to maintain ≥95% coverage.
- Include benchmarks for performance-critical code.
- Format code with
gofmtand ensure it passesgo vetandgolint(or equivalent linters). - Update documentation (e.g., godoc comments) and README if needed.
-
Commit Your Changes: Use Conventional Commits for commit messages. Examples:
feat(concurrency): add new semaphore implementation[PKG-XX]feat(concurrency): add new semaphore implementationfix(utils): resolve panic in edge casedocs: update README with new package detailstest(sync): add benchmarks for mutex
-
Test Thoroughly:
- Run
go test ./...to ensure all tests pass. - Aim for 95-100% test coverage (use
go test -cover). - Benchmark with
go test -bench=.and ensure no regressions.
- Run
-
Push and Open a Pull Request: Target your PR to the current open release branch (e.g.,
release/vX.Y.Z). Check the repository branches or recent PRs to identify the active release branch. Use the Pull Request template if available. Reference any related issues (e.g., "Closes #123"). -
Review Process: Maintainers will review your PR. Be responsive to feedback. Once approved, it will be merged.
- Follow Go's standard conventions (effective Go).
- Use meaningful variable/function names.
- Comment code thoroughly for godoc.
- Avoid allocations in hot paths; profile if unsure.
By contributing, you agree that your contributions will be licensed under the MIT License. Ensure any new files include the license header if required.
Thank you for helping improve pkg! If you have questions, feel free to open an issue or discussion. 🚀