bug: DuckDuckGo Search() discards ForEach error #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #1
Description
In
sites/duckduckgo/duckduckgo.go:88-133, theSearch()method stores the error fromdoc.ForEach()inerr(line 101) but then returnsres, nilon line 133 instead ofres, err.If
ForEachencounters an error while parsing results, the caller silently gets a partial result set with a nil error.Fix
Change line 133 from
return res, niltoreturn res, err.Starting work on this as part of PR 4 (also includes #6). Will fix
Search()to returnres, errand updateGetResults()interface to return([]Result, error).Work finished. PR: #35
Fixed
Search()to returnres, errinstead ofres, nil.