Misleading comments and small redundancies in the core path
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 半天
- 新手友好度
- 75/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go
- 领域
- cli, networking
调研方向
从引用的七行开始:internal/output/writer.go 和 internal/tui/model.go 中过时的 JSON 注释,internal/dns/resolver.go 中的 resolveWithLog 日志调用,main_session.go 与 main.go 之间重复的 validateArgs 调用,以及 tuiOptions 中的两条 fmt.Fprintf 警告。完成的标准是:注释描述的是流式输出,对于 NODATA 结果 -v 不再打印 Error: <nil>,重复的校验已移除,TUI 警告改为通过 diag 输出。使用 -simulate 或本地测试服务器,通过 make test 进行验证,不要使用真实域名。
由索引模型根据 Issue 内容生成。
描述
Summary
A checklist of small items: three comments that still say JSON output is buffered, a verbose log line that labels a definitive negative as a failure with Error: <nil>, a validation call that runs twice, and two TUI warnings that bypass the diagnostics writer.
Where
internal/output/writer.go:28internal/tui/model.go:329internal/tui/model.go:346internal/dns/resolver.go:479main_session.go:288main.go:304main_session.go:230
Details
Checklist, each item read at the cited line:
- writer.go:28: "FormatJSON buffers results and emits a single JSON array at completion". Since #181 it streams each element (
writeJSONElement, writer.go:255-284); the comment onEmitat 175-178 says so correctly. - tui/model.go:329-330 and 346-347: "finalize structured output so buffered JSON/CSV is written" and "buffered JSON array emitted": same stale description of JSON.
- resolver.go:478-479:
l.Logf("Failed to resolve: %s (Error: %v) in %s", domain, err, elapsed)also runs when the lookup succeeded with no records of the requested types (err == nil, the NODATA caseResolvehandles at 500-505), so-vprintsFailed to resolve: x (Error: <nil>)for a definitive negative. - main_session.go:288 calls
validateArgs, andvalidateFlags(called at 318) calls it again as its first statement (main.go:304). The second call can never fail. - main_session.go:230 and 240:
tuiOptionswrites its two warnings straight to stderr withfmt.Fprintf, bypassing thediagwriter built ten lines earlier (main_session.go:162), so-tui -log-format jsonemits plain text lines among JSON ones.
Impact
Readers are told JSON output is held in memory when it is not (relevant to anyone reasoning about memory or partial output), verbose logs label negatives as failures, and two small inconsistencies add noise. None changes results.
Suggested fix
Reword the three comments to "streamed as array elements; Finish closes the array". In resolveWithLog, branch on err == nil and log "No records: %s (%s) in %s". Drop the validateArgs call from validateFlags or from configure. Route the two TUI warnings through diag.Notice.
Acceptance criteria
- Each checklist item under Details is fixed
-
-vno longer printsError: <nil>
Getting started
- Relevant files:
internal/output/writer.go,internal/tui/model.go,internal/dns/resolver.go,main_session.go - How to run tests:
make test(orgo test ./...). Tests must stay hermetic: use-simulate,-simulate-zoneor the local DNS test server, never a live domain. - Related docs:
docs/DEVELOPER_GUIDE.md,docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at d0c56f0. Severity: low. Effort: S. audit-key: tech-debt|internal/output/writer.go|comments
- 主要语言
- Go
- 星标
- 1
- 派生
- 1
- 平均合并
- 6 小时 42 分钟
- 30 天内合并 PR
- 7
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/subenum 的其他 Issue
-
area: docs documentation good first issue severity: low
难度 2/5 1-3 小时 新手友好度 85/100
TMHSDigital/subenum#327 ·
维护者通常 1 天内回复
-
area: release dependencies good first issue severity: low
难度 2/5 1-3 小时 新手友好度 66/100
TMHSDigital/subenum#324 ·
维护者通常 1 天内回复
-
ci good first issue severity: low
难度 2/5 1-3 小时 新手友好度 62/100
TMHSDigital/subenum#323 ·
维护者通常 1 天内回复
-
area: output bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 76/100
TMHSDigital/subenum#319 ·
维护者通常 1 天内回复
-
community documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100
TMHSDigital/subenum#135 ·
维护者通常 1 天内回复
查看 TMHSDigital/subenum 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
GillMacedo/godebugdiff#13 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
GillMacedo/racesift#14 ·
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
gtsteffaniak/filebrowser#3395 ·
维护者通常 1 天内回复
-
effort:s impact:low raised-by:worker risk:low
难度 1/5 1 小时以内 新手友好度 70/100
medici-finance/assay#6496 · 1 条评论 ·
维护者通常 1 天内回复
-
kind/bug require/reproduce require/severity
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复