simpler initialization

This commit is contained in:
Stephen McQuay 2016-11-24 09:29:31 -08:00
parent d80caeb6bb
commit 546ddeff18
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D

View File

@ -52,9 +52,8 @@ func (l Link) String() string {
// Pages returns a stream of full urls starting at a given base page. // Pages returns a stream of full urls starting at a given base page.
func Pages(base string) <-chan Link { func Pages(base string) <-chan Link {
base = strings.TrimRight(base, "/") base = strings.TrimRight(base, "/")
visited := map[string]bool{} visited := map[string]bool{base: true}
links := URLs(base) links := URLs(base)
links = append(links, Link{From: "start", To: base})
r := make(chan Link) r := make(chan Link)