MCPcopy Index your code
hub / github.com/codegangsta/gin / runBin

Method runBin

lib/runner.go:98–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96}
97
98func (r *runner) runBin() error {
99 r.command = exec.Command(r.bin, r.args...)
100 stdout, err := r.command.StdoutPipe()
101 if err != nil {
102 return err
103 }
104 stderr, err := r.command.StderrPipe()
105 if err != nil {
106 return err
107 }
108
109 err = r.command.Start()
110 if err != nil {
111 return err
112 }
113
114 r.starttime = time.Now()
115
116 go io.Copy(r.writer, stdout)
117 go io.Copy(r.writer, stderr)
118 go func() {
119 r.command.Wait()
120 stdout.Close()
121 stderr.Close()
122 }()
123 return nil
124}
125
126func (r *runner) needsRefresh() bool {
127 info, err := r.Info()

Callers 1

RunMethod · 0.95

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected