diff options
Diffstat (limited to 'main.go')
| -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) }) |
