Run starts processing the inputs and extracts JavaScript sources into the runner's Results channel.
()
| 37 | |
| 38 | // Run starts processing the inputs and extracts JavaScript sources into the runner's Results channel. |
| 39 | func (r *runner) Run() error { |
| 40 | if !r.Options.Verbose { |
| 41 | log.SetOutput(io.Discard) |
| 42 | } |
| 43 | |
| 44 | go func() { |
| 45 | for _, input := range r.Options.Inputs { |
| 46 | switch input.Type { |
| 47 | case InputURL: |
| 48 | r.ProcessURLs(input.Data) |
| 49 | case InputResponse: |
| 50 | r.ProcessResponse(input.Data) |
| 51 | } |
| 52 | |
| 53 | if input, ok := input.Data.(io.Closer); ok { |
| 54 | input.Close() |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | close(r.Results) |
| 59 | }() |
| 60 | |
| 61 | r.listen() |
| 62 | |
| 63 | return nil |
| 64 | } |
| 65 | |
| 66 | func (r *runner) listen() { |
| 67 | for s := range r.Results { |
no test coverage detected