()
| 186 | } |
| 187 | |
| 188 | func (s *CompressedInput) worker() { |
| 189 | // Process incoming files on the s.files channel. |
| 190 | // If the channel is closed, it means that we processed all the |
| 191 | // channels that we should have processed, and we can safely exit. |
| 192 | // If the s.stopNow channel is signaled, we need to abort |
| 193 | // as soon as possible. |
| 194 | for { |
| 195 | select { |
| 196 | case fn, ok := <-s.files: |
| 197 | if !ok { |
| 198 | // Channel is closed, we're done |
| 199 | return |
| 200 | } |
| 201 | s.ParseFile(fn) |
| 202 | case <-s.stopNow: |
| 203 | return |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | func (s *CompressedInput) SetOutputChannel(data chan<- *baker.Data) { |
| 209 | s.data = data |
no test coverage detected