reviewed coverage report. remove some dead code. add a few comments to areas of code unlikely to hit.

This commit is contained in:
swaits committed 2015-02-17 00:44:39 -08:00
1 parent 42a40be62f
commit 4e335cfc8a
2 files changed
+3 -6

No files matched your search

+1 -6
View File
@@ -102,12 +102,7 @@ func crawlItem(item *httpItem, rchan chan<- *httpItem) {
}
// parse links
title, links := parseLinks(text) // TODO remove error from parseLinks, not needed
if err != nil {
item.linkType = tBroken
rchan <- item
return
}
title, links := parseLinks(text)
item.title = title
// walk links and add them as children to the current item
+2
View File
@@ -74,11 +74,13 @@ func fetchPage(item *httpItem) (string, error) {
// GET the url
resp, err := http.Get(item.url.String())
if err != nil {
// NOTE http.Head was already successful, this is highly likely to succeed
return "", err
}
// check response code
if resp.StatusCode != http.StatusOK {
// NOTE we already got StatusOK for http.Head, this is highly likely to succeed
return "", errFetchError
}