Contributing to cmd-stream-go

May 5, 2026 ยท View on GitHub

First off, thank you for considering contributing to cmd-stream-go! It's people like you who make the open-source community such an amazing place to learn, inspire, and create.

All types of contributions are welcome: from reporting bugs and suggesting new features to improving documentation or submitting code changes.

Code of Conduct

By participating in this project, you agree to abide by the Contributor Covenant to ensure a welcoming and inclusive environment for everyone.

Getting Started

Prerequisites

  • Go 1.24+: The project uses modern Go features (like the latest loop variable semantics).
  • golangci-lint: We use this for static analysis.

Fork and Clone

  1. Fork the repository on GitHub.

  2. Clone your fork locally:

    git clone https://github.com/YOUR_USERNAME/cmd-stream-go.git
    cd cmd-stream-go
    
  3. Add the upstream repository as a remote:

    git remote add upstream https://github.com/cmd-stream/cmd-stream-go.git
    

Reporting Issues

  • Bugs: Use the GitHub Issues page. Please include a clear description and, if possible, a minimal reproducible example.
  • Features: We're open to suggestions! Open an issue to discuss your idea before starting implementation.

Development Workflow

  1. Create a descriptive branch for your changes:

    git checkout -b feature/my-new-feature
    
  2. Make your changes, following the Coding Standards.

  3. Ensure all tests pass and there are no linting issues.

  4. Commit your changes using Conventional Commits:

    git commit -m "feat: add support for X"
    

Coding Standards

  • Effective Go: Follow the official Effective Go and Go Code Review Comments.
  • Documentation: All exported types, interfaces, and functions must have professional documentation comments. This is enforced by our linter.
  • Performance: As a high-performance framework, we prioritize efficiency. Avoid unnecessary allocations and use tools like prealloc and perfsprint (included in our linting suite).
  • Naming: Avoid "stuttering" in names. For example, use group.Client instead of group.GroupClient.

Testing and Linting

We maintain strict quality standards to ensure the framework remains reliable.

Static Analysis

Always run these checks before submitting a PR:

# General linting
golangci-lint run

# Security scan
gosec ./...

Our configuration focuses on performance markers, resource safety (body closing), and idiomatic style.

Testing

Run the full test suite:

go test ./...

New features should always include unit tests. For complex integrations, consider adding cases to the test/ directory.

Coverage

We monitor code coverage. To run tests with coverage:

go test -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -vE "test|testkit" | tr '\n' ',' | sed 's/,$//') ./...

(Note: Core logic coverage is prioritized; helpers in test/ and testkit/ are excluded.)

Pull Request Process

  1. Push your branch to your fork.
  2. Open a Pull Request against the main branch.
  3. Ensure the CI/CD pipeline (Static Analysis, Security Scan, and Coverage) passes.
  4. Once reviewed and approved, your changes will be merged.

License

By contributing to cmd-stream-go, you agree that your contributions will be licensed under the project's MIT License.


Thank you for your contribution!