summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-23 11:38:00 -0400
committerdemo <demo@antix1>2026-05-23 11:38:00 -0400
commit03f66133779ef2d35624ace7ecf1f427bece0b9b (patch)
tree357e1eeb0c9fec22e9d33165aa2a571894b41f82 /main.go
parent21cb8e5b5c752c458a8c829a0b7b1d4ba5ce442a (diff)
feat: add diagnostics to prove code is buggy
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 12 insertions, 0 deletions
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 {