MCPcopy Create free account
hub / github.com/003random/getJS / Read

Function Read

runner/runner.go:147–156  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
147func 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
158func (r *runner) ProcessResponse(data io.Reader) {
159 sources, err := extractor.ExtractSources(data)

Callers 1

ProcessURLsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected