refactor(server): 代码质量改进和 Go 1.21+ 现代化#18
Merged
Conversation
- 使用 slices.Contains 替换手写循环查找逻辑 - 使用 maps.Copy 替换手写 map 复制循环 - 修复 errcheck 警告: 显式忽略 fmt.Sscanf 和 conn.Close 返回值 - 为预留的 registerDashboardRoutes 函数添加 nolint:unused 指令 - 修复测试文件中的 errcheck 警告 - 修复 sandbox 使用 bash 代替 sh 以支持 ulimit -u
lwmacct
force-pushed
the
tmp/251214-0053
branch
from
December 13, 2025 17:26
cbbe9a7 to
588ea12
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
slices.Contains替换手写循环查找逻辑(middleware, dashboard_events)maps.Copy替换手写 map 复制循环(health.go)fmt.Sscanf和conn.Close返回值registerDashboardRoutes函数添加//nolint:unused指令Changes
cmd/aster-server/main.gofmt.Sscanf错误server/handlers/remote_agent.goconn.Close()错误server/middleware.goslices.Contains替换循环server/handlers/dashboard_events.goslices.Contains替换 2 处循环server/observability/health.gomaps.Copy替换循环server/routes.go//nolint:unusedpkg/config/loader_test.gopkg/executionplan/executor_test.goTest plan
golangci-lint run --new通过(0 issues)go build ./cmd/aster ./cmd/aster-server通过