Read is a wrapper around the bufio.Scanner Text() method. Upon reading from the input, the line is automatically parsed to a *url.URL. An io.EOF error is returned when there are no more lines.
(input io.Reader)
| 145 | // Upon reading from the input, the line is automatically parsed to a *url.URL. |
| 146 | // An io.EOF error is returned when there are no more lines. |
| 147 | func Read(input io.Reader) func() (*url.URL, error) { |
| 148 | scanner := bufio.NewScanner(input) |
| 149 | return func() (*url.URL, error) { |
| 150 | if !scanner.Scan() { |
| 151 | return nil, io.EOF |
| 152 | } |
| 153 | |
| 154 | return url.Parse(scanner.Text()) |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | func (r *runner) ProcessResponse(data io.Reader) { |
| 159 | sources, err := extractor.ExtractSources(data) |