First of all, thank you for your interest in and support of the Go-Spring project!
Before contributing, please read our Contributor Code of Conduct.
We welcome all kinds of contributions, including reporting issues, improving documentation, fixing bugs, and developing new features. Please follow the guidelines below to contribute.
- Submitting Issues
- Submitting Pull Requests
- Branch Naming Guidelines
- Local Development Environment
- Testing
- Contact Us
- Search existing issues before submitting to avoid duplicates.
- Provide clear reproduction steps, expected behavior, and actual results.
- Include error logs and environment information if applicable.
-
Fork the repository and create a new branch
git checkout -b feature/your-feature-name
-
Maintain consistent coding style
- Follow Go’s official style guidelines (
gofmt,golint,go vet). - Recommended:
golangci-lintfor local linting.
- Follow Go’s official style guidelines (
-
Write tests
-
All new features or bug fixes must include unit tests.
-
Use Go’s
testingpackage; test files should be namedxxx_test.go. -
Example:
func TestAdd(t *testing.T) { result := Add(1, 2) if result != 3 { t.Errorf("expected 3, got %d", result) } }
-
-
Update documentation
- If your changes affect usage or APIs, update README or code comments.
-
Submit and create a Pull Request
-
Clearly describe:
- What: What changes are made
- Why: Why the changes are needed
- How: How it was implemented
- Testing: How it was tested
-
Link related issues if applicable.
-
feature/xxx– New featurefix/xxx– Bug fixdoc/xxx– Documentation updatesrefactor/xxx– Code refactoring
-
Recommended Go version: latest stable release (e.g.,
go1.21+) -
Use Go Modules for dependency management.
-
Make sure all tests pass before submitting:
go test ./...
- Run
go test ./...to ensure all tests pass. - For examples or integration tests, provide instructions if needed.
- Open an issue on GitHub for questions or feedback.
- Join project discussions via the community forum or chat.
Thank you for contributing to Go-Spring!
首先,感谢你关注并支持 Go-Spring 项目! 在贡献之前,请先阅读我们的 贡献者行为准则。
我们欢迎各种形式的贡献,包括提交 Issue、完善文档、修复 Bug、开发新功能等。请按照以下指引参与贡献。
- 在提交前,请先搜索现有 Issue,避免重复。
- 提供清晰的复现步骤、预期行为以及实际结果。
- 如有错误日志或运行环境信息,请一并附上。
-
Fork 仓库并创建新分支
git checkout -b feature/your-feature-name
-
保持一致的代码风格
- 遵循 Go 官方代码规范(使用
gofmt、golint、go vet)。 - 推荐使用
golangci-lint进行本地检查。
- 遵循 Go 官方代码规范(使用
-
编写测试用例
-
所有新功能或 Bug 修复必须配备单元测试。
-
使用 Go 内置
testing包,测试文件命名为xxx_test.go。 -
示例:
func TestAdd(t *testing.T) { result := Add(1, 2) if result != 3 { t.Errorf("expected 3, got %d", result) } }
-
-
更新文档
- 如果变更影响使用或接口,请同步更新 README 或代码注释。
-
提交并创建 Pull Request
-
清晰说明:
- What:本次修改的内容
- Why:修改原因
- How:实现方式
- Testing:测试情况
-
关联相关 Issue(如有)。
-
feature/xxx– 新功能fix/xxx– Bug 修复doc/xxx– 文档更新refactor/xxx– 代码重构
-
Go 版本:推荐使用最新版稳定版(如
go1.21+) -
使用 Go Modules 管理依赖
-
提交前确保所有测试通过:
go test ./...
- 运行
go test ./...确保所有测试通过 - 对于示例或集成测试,请提供使用说明(如适用)
- 可通过 GitHub Issue 提问或反馈
- 参与项目讨论区交流
感谢你为 Go-Spring 做出的贡献!