From 03f66133779ef2d35624ace7ecf1f427bece0b9b Mon Sep 17 00:00:00 2001 From: demo Date: Sat, 23 May 2026 11:38:00 -0400 Subject: feat: add diagnostics to prove code is buggy --- main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.go b/main.go index a3ee0cf..33989df 100644 --- a/main.go +++ b/main.go @@ -51,6 +51,8 @@ func main() { seen := make(map[url.URL]bool) i := 1 + // FIXME: unfortunately, this example leaks, but I don't know + // how to fix that yet. loop: for list := range worklist { for _, u := range list { @@ -73,6 +75,16 @@ loop: } } } + + // For now, print out some diagnostics that prove that there + // are still pending sends on the worklist channel. + for batch := range worklist { + fmt.Printf("%d\n", len(batch)) + + for _, u := range batch { + fmt.Printf("-- %s\n", &u) + } + } } func crawl(ctx context.Context, u url.URL) []url.URL { -- cgit v1.2.3