diff options
| author | demo <demo@antix1> | 2026-05-28 16:41:53 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-28 16:41:53 -0400 |
| commit | 0d4e903fef12b5ed7d79cc097f3b18d2869ada29 (patch) | |
| tree | 56cc9d5560f857142317980ce0d3b5052a4eb4d7 | |
| parent | d217b6d89d03487bfa1d45c5cb750b27de8a45e5 (diff) | |
docs: add some comments
| -rw-r--r-- | main.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -24,6 +24,8 @@ func main() { flag.Parse() + // Vet the given CLI arguments for things like negative or + // missing values. if *maxConcurrency == 0 { log.Fatal("Missing -c argument") } @@ -44,6 +46,8 @@ func main() { log.Fatalf("Invalid -depth argument: %d", *maxDepth) } + // Add "https://" scheme prefix if missing. It looks like we + // have to do this before the parsing step, not after. if !strings.HasPrefix(*startRawURL, "http://") && !strings.HasPrefix(*startRawURL, "https://") { *startRawURL = "https://" + *startRawURL fmt.Printf("start url: %s\n", *startRawURL) @@ -54,6 +58,8 @@ func main() { log.Fatal(err) } + // Our web crawlers use concurrency: check if any goroutines + // have leaked. getLeakProfile(func() { classic(*startURL, *maxConcurrency, *maxURLs, *maxDepth) }) |
