Skip to content

Commit 1a77e16

Browse files
lvan100lianghuan
authored andcommitted
refactor(golang): refactoring http processing
1 parent 6c482c8 commit 1a77e16

File tree

5 files changed

+460
-119
lines changed

5 files changed

+460
-119
lines changed

CODE_OF_CONDUCT.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Contributor Code of Conduct
2+
3+
Thank you for your interest in and support of the Go-Spring project!
4+
5+
To cultivate an open, respectful, inclusive, and professional community, we ask that all participants follow this Code
6+
of Conduct in every interaction—whether reporting issues, submitting code, engaging in discussions, or participating in
7+
any official project activity.
8+
9+
## Scope
10+
11+
This Code of Conduct applies to all interactions related to the Go-Spring project, including but not limited to:
12+
13+
* Issues and pull requests on the repository
14+
* Discussions in forums, chat channels, or mailing lists
15+
* Contributions to documentation, wiki, or website
16+
* Participation in online or offline project events
17+
18+
## Our Commitment
19+
20+
We are committed to providing a harassment-free experience for everyone, regardless of age, background, identity, or
21+
experience level. We value and support diversity and inclusivity within our community.
22+
23+
## Encouraged Behavior
24+
25+
* Communicate with respect and courtesy
26+
* Welcome and consider constructive feedback
27+
* Appreciate diverse perspectives and technical choices
28+
* Demonstrate patience and empathy in collaborations
29+
* Contribute positively to a welcoming and supportive environment
30+
31+
**Examples of encouraged behavior:**
32+
33+
* Providing constructive code reviews
34+
* Welcoming newcomers with guidance
35+
* Sharing knowledge in a respectful manner
36+
37+
## Unacceptable Behavior
38+
39+
* Use of discriminatory, abusive, or offensive language or conduct
40+
* Harassment, threats, or personal attacks
41+
* Sharing explicit content or inappropriate links
42+
* Deliberate disruption of constructive efforts
43+
* Impersonation or violation of personal privacy
44+
45+
**Examples of unacceptable behavior:**
46+
47+
* Using slurs or offensive language
48+
* Harassing contributors for opinions or technical choices
49+
* Posting inappropriate content or links
50+
51+
## Reporting Violations
52+
53+
If you witness or experience a violation of this Code of Conduct, please report it to the project maintainers via email
54+
or by submitting an anonymous issue.
55+
56+
When reporting a violation, please provide:
57+
58+
* Description of the incident
59+
* Links to relevant content or screenshots
60+
* Names of involved participants (if known)
61+
62+
Maintainers will respond within 48 hours and handle all reports confidentially.
63+
64+
## Enforcement and Consequences
65+
66+
Project maintainers are responsible for upholding this Code of Conduct. They have the authority to remove, edit, or
67+
reject comments, commits, code, wiki edits, issues, or other contributions that violate these guidelines, and to take
68+
further action as necessary.
69+
70+
Possible consequences for violations include:
71+
72+
* Removal of contributions or comments
73+
* Temporary or permanent suspension of project access
74+
* Reporting to relevant platform authorities
75+
76+
Appeals can be submitted via email to the maintainers.
77+
78+
---
79+
80+
# 贡献者行为准则
81+
82+
首先,感谢你关注并支持 Go-Spring 项目!
83+
84+
为营造一个开放、友善、包容和专业的社区氛围,我们制定了本行为准则。无论你是报告问题、提交代码、参与讨论,还是以其他形式参与项目,都请遵循以下准则。
85+
86+
## 适用范围
87+
88+
本行为准则适用于与 Go-Spring 项目相关的所有活动,包括但不限于:
89+
90+
* 仓库中的 Issue 和 Pull Request
91+
* 论坛、聊天群或邮件列表中的讨论
92+
* 文档、Wiki 或网站的贡献
93+
* 线上或线下的官方项目活动
94+
95+
## 我们的承诺
96+
97+
我们承诺为每一位参与者提供一个免受骚扰干扰的环境,无论年龄、背景、身份或经验水平。我们欢迎来自不同背景的贡献者,共同建设一个多元、包容的社区。
98+
99+
## 倡导的行为
100+
101+
* 保持尊重、礼貌的沟通方式
102+
* 乐于接受建设性的意见与反馈
103+
* 尊重不同的观点与技术选择
104+
* 在协作中体现耐心与包容
105+
* 积极参与,共建积极向上的社区氛围
106+
107+
**正面行为示例:**
108+
109+
* 提供建设性的代码审查
110+
* 欢迎新人并提供指导
111+
* 尊重他人分享知识
112+
113+
## 不被接受的行为
114+
115+
* 使用歧视性、侮辱性或攻击性的言语与行为
116+
* 人身攻击、骚扰或威胁他人
117+
* 发布淫秽内容或不当链接
118+
* 蓄意干扰他人正常贡献
119+
* 冒充他人或侵犯他人隐私
120+
121+
**违规行为示例:**
122+
123+
* 使用侮辱性词语或攻击性语言
124+
* 因观点或技术选择骚扰贡献者
125+
* 发布不当内容或链接
126+
127+
## 举报违规行为
128+
129+
若你遇到或目击违反本行为准则的情况,请通过电子邮件联系项目维护者,或通过 Issue 匿名举报。
130+
131+
提交举报时,请尽量提供以下信息:
132+
133+
* 事件描述
134+
* 相关内容链接或截图
135+
* 相关人员姓名(如已知)
136+
137+
维护者将在 48 小时内回复,并确保信息保密。
138+
139+
## 执行与后果
140+
141+
项目维护者有权也有责任删除、修改或拒绝任何违反行为准则的评论、提交、代码、Wiki 编辑、Issue 或其他形式的贡献内容,并在必要时采取进一步措施。
142+
143+
违规可能导致的后果包括:
144+
145+
* 删除贡献内容或评论
146+
* 暂停或永久禁用项目访问权限
147+
* 向相关平台报告
148+
149+
如对处理结果有异议,可通过电子邮件向维护者提交申诉。

CONTRIBUTING.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Contributing to Go-Spring
2+
3+
First of all, thank you for your interest in and support of the Go-Spring project!
4+
Before contributing, please read our [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
5+
6+
We welcome all kinds of contributions, including reporting issues, improving documentation, fixing bugs, and developing
7+
new features. Please follow the guidelines below to contribute.
8+
9+
## Table of Contents
10+
11+
- [Submitting Issues](#submitting-issues)
12+
- [Submitting Pull Requests](#submitting-pull-requests)
13+
- [Branch Naming Guidelines](#branch-naming-guidelines)
14+
- [Local Development Environment](#local-development-environment)
15+
- [Testing](#testing)
16+
- [Contact Us](#contact-us)
17+
18+
## Submitting Issues
19+
20+
- Search existing issues before submitting to avoid duplicates.
21+
- Provide clear reproduction steps, expected behavior, and actual results.
22+
- Include error logs and environment information if applicable.
23+
24+
## Submitting Pull Requests
25+
26+
1. **Fork the repository and create a new branch**
27+
28+
```bash
29+
git checkout -b feature/your-feature-name
30+
````
31+
32+
2. **Maintain consistent coding style**
33+
34+
* Follow Go’s official style guidelines (`gofmt`, `golint`, `go vet`).
35+
* Recommended: [`golangci-lint`](https://github.com/golangci/golangci-lint) for local linting.
36+
37+
3. **Write tests**
38+
39+
* All new features or bug fixes must include unit tests.
40+
* Use Go’s `testing` package; test files should be named `xxx_test.go`.
41+
* Example:
42+
43+
```go
44+
func TestAdd(t *testing.T) {
45+
result := Add(1, 2)
46+
if result != 3 {
47+
t.Errorf("expected 3, got %d", result)
48+
}
49+
}
50+
```
51+
52+
4. **Update documentation**
53+
54+
* If your changes affect usage or APIs, update README or code comments.
55+
56+
5. **Submit and create a Pull Request**
57+
58+
* Clearly describe:
59+
60+
* **What**: What changes are made
61+
* **Why**: Why the changes are needed
62+
* **How**: How it was implemented
63+
* **Testing**: How it was tested
64+
* Link related issues if applicable.
65+
66+
## Branch Naming Guidelines
67+
68+
* `feature/xxx` – New feature
69+
* `fix/xxx` – Bug fix
70+
* `doc/xxx` – Documentation updates
71+
* `refactor/xxx` – Code refactoring
72+
73+
## Local Development Environment
74+
75+
* Recommended Go version: latest stable release (e.g., `go1.21+`)
76+
* Use Go Modules for dependency management.
77+
* Make sure all tests pass before submitting:
78+
79+
```bash
80+
go test ./...
81+
```
82+
83+
## Testing
84+
85+
* Run `go test ./...` to ensure all tests pass.
86+
* For examples or integration tests, provide instructions if needed.
87+
88+
## Contact Us
89+
90+
* Open an issue on GitHub for questions or feedback.
91+
* Join project discussions via the community forum or chat.
92+
93+
Thank you for contributing to Go-Spring!
94+
95+
---
96+
97+
# 贡献 Go-Spring 的指南
98+
99+
首先,感谢你关注并支持 Go-Spring 项目!
100+
在贡献之前,请先阅读我们的 [贡献者行为准则](CODE_OF_CONDUCT.md)。
101+
102+
我们欢迎各种形式的贡献,包括提交 Issue、完善文档、修复 Bug、开发新功能等。请按照以下指引参与贡献。
103+
104+
## 目录
105+
106+
* [提交 Issue](#提交-issue)
107+
* [提交 Pull Request](#提交-pull-request)
108+
* [分支命名规范](#分支命名规范)
109+
* [本地开发环境要求](#本地开发环境要求)
110+
* [测试](#测试)
111+
* [联系我们](#联系我们)
112+
113+
## 提交 Issue
114+
115+
* 在提交前,请先搜索现有 Issue,避免重复。
116+
* 提供清晰的复现步骤、预期行为以及实际结果。
117+
* 如有错误日志或运行环境信息,请一并附上。
118+
119+
## 提交 Pull Request
120+
121+
1. **Fork 仓库并创建新分支**
122+
123+
```bash
124+
git checkout -b feature/your-feature-name
125+
```
126+
127+
2. **保持一致的代码风格**
128+
129+
* 遵循 Go 官方代码规范(使用 `gofmt``golint``go vet`)。
130+
* 推荐使用 [`golangci-lint`](https://github.com/golangci/golangci-lint) 进行本地检查。
131+
132+
3. **编写测试用例**
133+
134+
* 所有新功能或 Bug 修复必须配备单元测试。
135+
* 使用 Go 内置 `testing` 包,测试文件命名为 `xxx_test.go`
136+
* 示例:
137+
138+
```go
139+
func TestAdd(t *testing.T) {
140+
result := Add(1, 2)
141+
if result != 3 {
142+
t.Errorf("expected 3, got %d", result)
143+
}
144+
}
145+
```
146+
147+
4. **更新文档**
148+
149+
* 如果变更影响使用或接口,请同步更新 README 或代码注释。
150+
151+
5. **提交并创建 Pull Request**
152+
153+
* 清晰说明:
154+
155+
* **What**:本次修改的内容
156+
* **Why**:修改原因
157+
* **How**:实现方式
158+
* **Testing**:测试情况
159+
* 关联相关 Issue(如有)。
160+
161+
## 分支命名规范
162+
163+
* `feature/xxx` – 新功能
164+
* `fix/xxx` – Bug 修复
165+
* `doc/xxx` – 文档更新
166+
* `refactor/xxx` – 代码重构
167+
168+
## 本地开发环境要求
169+
170+
* Go 版本:推荐使用最新版稳定版(如 `go1.21+`
171+
* 使用 Go Modules 管理依赖
172+
* 提交前确保所有测试通过:
173+
174+
```bash
175+
go test ./...
176+
```
177+
178+
## 测试
179+
180+
* 运行 `go test ./...` 确保所有测试通过
181+
* 对于示例或集成测试,请提供使用说明(如适用)
182+
183+
## 联系我们
184+
185+
* 可通过 GitHub Issue 提问或反馈
186+
* 参与项目讨论区交流
187+
188+
感谢你为 Go-Spring 做出的贡献!

0 commit comments

Comments
 (0)