Close links chan on crawl completion

This commit is contained in:
James Mills
2021-02-02 14:16:17 +10:00
parent e1b0dd173f
commit 0e142fc233
2 changed files with 426 additions and 0 deletions

View File

@@ -56,5 +56,11 @@ func FindLinks(url string) chan string {
c.Visit(url)
defer func() {
close(links)
}()
go c.Wait()
return links
}