scan.Run should always end with exactly one EventDone
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in internal/scan/runner.go: read scan.Run, its early-exit paths, and the EventError documentation. Add coverage for each listed early exit and check that each produces exactly one EventDone; then review the CLI, TUI, and pkg/subenum consumers named in the issue. Done means all tests pass and no consumer handles a channel closing without EventDone.
由索引模型根据 Issue 内容生成。
描述
Why it matters
scan.Run has two shapes of ending, and every consumer has to know both. Three consumers now each handle it separately: the CLI (main.go), the TUI (internal/tui/model.go, scan_view.go), and pkg/subenum, which adds an extra KindDone so its callers see one shape.
Evidence
- On five early-exit paths,
scan.RunsendsEventErrorand returns withoutEventDone: an out-of-scope domain, the recursion ceiling, a failed preflight, a failed wildcard check, and a wildcard zone without-force(internal/scan/runner.go, about lines 434–495). Only the deferredclose(events)runs. EventErroris documented as "non-fatal error message" (runner.go:345). In practice, five of its six uses stop the scan. The sixth, the reliability guard at line 877, is followed byEventDone.- The CLI comment says "Early errors such as wildcard detection close the channel without EventDone". The TUI has a
closedflag for "the scan ended without EventDone".
Suggested approach
- Have
scan.Runalways send exactly oneEventDone, withStats(all zero when nothing was scanned), even after an earlyEventError. - Fix the
EventErrordoc comment to say it usually means the scan stopped. - Then remove the special cases: the CLI drain comment, the TUI
closedpath, and the synthesized event inpkg/subenum'sRun.
Done when
scan.Run always ends with one EventDone, a test covers each early-exit path, and none of the three consumers has to handle a channel that closes without one.
- 主要语言
- Go
- 星标
- 1
- 派生
- 1
- 平均合并
- 5 天 2 小时
- 30 天内合并 PR
- 3
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/subenum 的其他 Issue
-
area: cli enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
TMHSDigital/subenum#136 ·
维护者通常 1 天内回复
-
community documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100
TMHSDigital/subenum#135 ·
维护者通常 1 天内回复
-
area: dns enhancement good first issue
难度 2/5 1 小时以内 新手友好度 90/100
TMHSDigital/subenum#134 ·
维护者通常 1 天内回复
-
community marketing priority: low
难度 5/5 一周以上 新手友好度 35/100
TMHSDigital/subenum#132 · 1 条评论 ·
维护者通常 1 天内回复
-
feature priority: low
难度 5/5 一周以上 新手友好度 35/100
TMHSDigital/subenum#131 ·
维护者通常 1 天内回复
查看 TMHSDigital/subenum 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
open-telemetry/opentelemetry-go-compile-instrumentation#1467 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
modelcontextprotocol/go-sdk#1367 · 1 条评论 ·
维护者通常 1 天内回复
-
Python 3.15 support可能已有人在做 @amnesiaof 今天认领。 未关闭L: python L: python:uv
难度 2/5 1-3 小时 新手友好度 72/100
dependabot/dependabot-core#16524 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
duplication
难度 2/5 1-3 小时 新手友好度 78/100
openvibely/openvibely#1443 ·
维护者通常 2 天内回复