Thank you for your interest in contributing to gtvapi! This document provides guidelines and instructions for contributing.
Please be respectful and constructive in all interactions. We aim to maintain a welcoming and inclusive community.
Before submitting a bug report:
- Check the existing issues to avoid duplicates
- Collect information about your environment (Go version, OS, etc.)
- Provide a minimal reproducible example if possible
Create an issue with:
- A clear, descriptive title
- Steps to reproduce the problem
- Expected behavior
- Actual behavior
- Any relevant logs or error messages
Feature suggestions are welcome! Please:
- Check existing issues for similar proposals
- Clearly describe the feature and its use case
- Explain why it would be beneficial
- Consider providing a rough implementation outline
-
Fork the repository and create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes following the coding standards below
-
Add tests for your changes
- Unit tests for new functionality
- Update existing tests if needed
- Ensure all tests pass:
go test ./...
-
Update documentation
- Add GoDoc comments for new public APIs
- Update README.md if needed
- Add entries to CHANGELOG.md
-
Run quality checks
make lint make test make fmt -
Commit your changes with clear, descriptive messages
git commit -m "Add feature: description of your changes" -
Push to your fork and submit a pull request
-
Respond to feedback during the review process
- Follow the official Go Code Review Comments
- Use
gofmtorgofumptfor formatting - Follow idiomatic Go patterns
- Keep functions small and focused
- Add GoDoc comments for all exported types, functions, and constants
- Use complete sentences in comments
- Provide examples for complex functionality
- Keep documentation up-to-date with code changes
- Write table-driven tests where appropriate
- Use meaningful test names that describe what is being tested
- Test edge cases and error conditions
- Aim for high test coverage (target: 80%+)
- Use mocks for external dependencies
- Return errors rather than panicking
- Wrap errors with context using
fmt.Errorfwith%w - Use meaningful error messages
- Check all errors
- Use descriptive names for variables and functions
- Follow Go naming conventions (camelCase for unexported, PascalCase for exported)
- Avoid abbreviations unless they're widely understood
- Use consistent terminology throughout the codebase
-
Clone the repository
git clone https://github.com/wehmoen-dev/gtvapi.git cd gtvapi -
Install dependencies
go mod download
-
Run tests
go test -v ./... -
Run linting
golangci-lint run
Use clear and descriptive commit messages:
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code refactoring without changing functionality
- test: Adding or updating tests
- chore: Maintenance tasks (dependency updates, build changes, etc.)
Example:
feat: add retry logic with exponential backoff
- Implement retry mechanism for failed API requests
- Add configurable retry parameters in ClientConfig
- Update tests to cover retry scenarios
If you have questions about contributing, feel free to open an issue for discussion.
Thank you for contributing to gtvapi!