We appreciate your interest in contributing to this project! This document outlines the process for submitting code, documentation, or other types of contributions. Please read and follow these guidelines to ensure a smooth collaboration with the project maintainers.
Before participating in the project, please read our Code of Conduct. By engaging with this repository and its respective community, you agree to abide by its terms.
- Fork the project on GitHub to your own account.
- If you are new to forking repositories, you can find a detailed guide on forking here.
- Clone your fork to your local development environment:
git clone git@github.com:bilbilak/godini.git cd bilbilak
- Make sure you have the necessary tools installed, such as Go and any dependencies required by the project.
NOTE: If you'd like to contribute to our documentation, please use MyRepos tool to clone the project's Wiki. You can initiate the clone by running mr checkout
as configured in the .mrconfig
file. This will create the sub-repository under the docs/wiki/
directory, separate from the main repository. To interact with this sub-repository, it's important to familiarize yourself with other mr
commands.
When contributing to this project, please adhere to the following guidelines:
- Coding Conventions: Follow established coding conventions. This will ensure that the code is consistent, readable, and maintainable. Before submitting your code, run it through gofmt for code formatting and golangci-lint for linting. These tools enforce coding standards, catch common mistakes, and can suggest more idiomatic ways of writing Go. Address any issues or warnings that these tools report before submitting your contribution. Below, you can find comprehensive guides on coding conventions:
- Code Refactoring: Consider using refactoring techniques to improve the structure of existing code without changing its behavior. Familiarize yourself with various design patterns that can make your code more efficient, scalable, and maintainable. You can find comprehensive guides and examples at Refactoring Guru.
- Cross-Platform Compatibility: When writing your Go code, ensure it is cross-platform compatible. Go is designed to be portable and can compile for multiple platforms with ease. Avoid assumptions or dependencies that tie your code to a specific operating system or environment.
- Performance Optimization: Write efficient and performant code. Go is known for its simplicity and speed, but that doesn't exempt us from good practices. Avoid unnecessary computation, prefer efficient data structures, and leverage Go's concurrency primitives such as goroutines and channels when appropriate. Use benchmarking tools like benchstat to measure performance objectively.
- Testing: For each functionality you add or change, make sure to create corresponding tests. Tests ensure that your code works as expected and prevents future changes from breaking your functionality. Go’s built-in testing framework (
testing
package) makes it easy to write unit tests for your code. Run these tests before submitting your changes to ensure they pass.
- Create a new branch for your contribution:
git checkout -b feature/your-feature
- Make your changes and commit them with a descriptive message:
git add . git commit -m "Add a brief description of your changes"
- Writing clear and concise commit messages is important. For tips on how to write good commit messages, you can refer to this guide tailored for projects following the Gitflow approach.
- Push your changes to your fork on GitHub:
git push origin feature/your-feature
- Create a pull request on the project's GitHub repository, comparing the project's
develop
branch with your feature branch. - Fill out the pull request template with a description of your changes, and reference any relevant issues or discussions.
After submitting your pull request, the project maintainers will review your contribution. They may request changes or provide feedback before merging your changes into the development branch. Please be patient and address any comments or concerns raised by the maintainers.
💖 Thank you for your contribution! Your collaboration helps improve the project for everyone.