Misleading comments and small redundancies in the core path
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- cli, networking
Hướng nghiên cứu
Bắt đầu với bảy dòng được trích dẫn: các chú thích JSON lỗi thời trong internal/output/writer.go và internal/tui/model.go, lệnh ghi log resolveWithLog trong internal/dns/resolver.go, lệnh gọi validateArgs bị trùng giữa main_session.go và main.go, và hai cảnh báo fmt.Fprintf trong tuiOptions. Hoàn thành khi các chú thích mô tả đầu ra dạng luồng, -v không còn in Error: <nil> cho kết quả NODATA, việc kiểm tra hợp lệ bị trùng được loại bỏ, và các cảnh báo TUI đi qua diag. Kiểm tra bằng make test với -simulate hoặc máy chủ kiểm thử cục bộ, không dùng tên miền thật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 1
- Fork
- 1
- Merge trung bình
- 6 giờ 42 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/subenum
-
area: docs documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/subenum#327 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: release dependencies good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
TMHSDigital/subenum#324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
TMHSDigital/subenum#323 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: output bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
TMHSDigital/subenum#319 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/subenum#135 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/subenum
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
GillMacedo/godebugdiff#13 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GillMacedo/racesift#14 ·
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
gtsteffaniak/filebrowser#3395 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:s impact:low raised-by:worker risk:low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
medici-finance/assay#6496 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug require/reproduce require/severity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày