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

Method Run

runner/runner.go:39–64  ·  view source on GitHub ↗

Run starts processing the inputs and extracts JavaScript sources into the runner's Results channel.

()

Source from the content-addressed store, hash-verified

37
38// Run starts processing the inputs and extracts JavaScript sources into the runner's Results channel.
39func (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
66func (r *runner) listen() {
67 for s := range r.Results {

Callers 1

mainFunction · 0.80

Calls 3

ProcessURLsMethod · 0.95
ProcessResponseMethod · 0.95
listenMethod · 0.95

Tested by

no test coverage detected