Skip to content

Commit 2911e3d

Browse files
committed
fix: remove unused functions from crawler (U1000)
- Remove extractLinksWithErr and extractFormsWithErr - dead code with no callers in the codebase All tests pass with -race flag.
1 parent 1dd61e7 commit 2911e3d

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

internal/crawler/parse.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,6 @@ func extractLinks(pageURL string, body []byte) []Link {
3737
return extractLinksFromDoc(pageURL, doc)
3838
}
3939

40-
// extractLinksWithErr extracts links and reports any parse error via errOut.
41-
func extractLinksWithErr(pageURL string, body []byte, errOut *error) []Link {
42-
doc, err := html.Parse(bytes.NewReader(body))
43-
if err != nil {
44-
if errOut != nil {
45-
*errOut = err
46-
}
47-
// Still attempt extraction from whatever was parsed
48-
if doc == nil {
49-
return nil
50-
}
51-
}
52-
return extractLinksFromDoc(pageURL, doc)
53-
}
54-
5540
// extractLinksFromDoc extracts links from a pre-parsed HTML document.
5641
func extractLinksFromDoc(pageURL string, doc *html.Node) []Link {
5742
if doc == nil {
@@ -174,20 +159,6 @@ func extractForms(body []byte) []Form {
174159
return extractFormsFromDoc(doc)
175160
}
176161

177-
// extractFormsWithErr extracts forms and reports any parse error via errOut.
178-
func extractFormsWithErr(body []byte, errOut *error) []Form {
179-
doc, err := html.Parse(bytes.NewReader(body))
180-
if err != nil {
181-
if errOut != nil {
182-
*errOut = err
183-
}
184-
if doc == nil {
185-
return nil
186-
}
187-
}
188-
return extractFormsFromDoc(doc)
189-
}
190-
191162
// extractFormsFromDoc extracts forms from a pre-parsed HTML document.
192163
func extractFormsFromDoc(doc *html.Node) []Form {
193164
if doc == nil {

0 commit comments

Comments
 (0)