simpler initialization
This commit is contained in:
parent
d80caeb6bb
commit
546ddeff18
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user