style(netutil,server,test): 修复代码格式问题,更新文档

- 修复 server.go 缩进问题
- 添加文件末尾换行符
- 格式化测试文件表格对齐
- 更新 update-prompts.md 添加新任务

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-04-07 11:38:54 +08:00
parent ff260def3b
commit 3cc2dc7625
7 changed files with 19 additions and 17 deletions

View File

@ -15,6 +15,8 @@
/plan 深度分析一个完善测试的方案
/ultrawork 分析并完善测试覆盖率,每完成一个功能点提交一次
## 注释
/ultrawork 参考 @docs/comments.md深度分析项目注释是否完善

View File

@ -65,10 +65,10 @@ func TestExtractClientIP(t *testing.T) {
func TestExtractClientIPNet(t *testing.T) {
tests := []struct {
name string
xff string
xri string
want net.IP
name string
xff string
xri string
want net.IP
}{
{
name: "X-Forwarded-For valid IP",

View File

@ -4,11 +4,11 @@ import "testing"
func TestParseTargetURL(t *testing.T) {
tests := []struct {
name string
targetURL string
addDefaultPort bool
wantAddr string
wantIsTLS bool
name string
targetURL string
addDefaultPort bool
wantAddr string
wantIsTLS bool
}{
// HTTP without port
{

View File

@ -340,8 +340,8 @@ func (s *Server) startSingleMode() error {
// 注册代理路由
s.registerProxyRoutes(router, &s.config.Server)
// 静态文件服务
s.registerStaticHandler(router, &s.config.Server)
// 静态文件服务
s.registerStaticHandler(router, &s.config.Server)
// 构建中间件链
chain, err := s.buildMiddlewareChain(&s.config.Server)