Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

scan.Run should always end with exactly one EventDone

Open
#99 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

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.

Written by the indexing model from the issue text.

Description

area: scan enhancement

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.Run sends EventError and returns without EventDone: 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 deferred close(events) runs.
  • EventError is 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 by EventDone.
  • The CLI comment says "Early errors such as wildcard detection close the channel without EventDone". The TUI has a closed flag for "the scan ended without EventDone".

Suggested approach

  • Have scan.Run always send exactly one EventDone, with Stats (all zero when nothing was scanned), even after an early EventError.
  • Fix the EventError doc comment to say it usually means the scan stopped.
  • Then remove the special cases: the CLI drain comment, the TUI closed path, and the synthesized event in pkg/subenum's Run.

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.

Dominant language
Go
Stars
1
Forks
1
Avg merge
14d 9h
Merged PRs (30d)
1

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TMHSDigital/subenum

All issues in TMHSDigital/subenum

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.