provisionLogWriter creates a WriteCloser that will log each JSON formatted terraform log. The WriteCloser must be closed by the caller to end logging, after which the returned channel will be closed to indicate that logging of the written data has finished. Failure to close the WriteCloser will le
(sink logSink)
| 643 | // closed by the caller to end logging, after which the returned channel will be closed to indicate that logging of the |
| 644 | // written data has finished. Failure to close the WriteCloser will leak a goroutine. |
| 645 | func (e *executor) provisionLogWriter(sink logSink) (io.WriteCloser, <-chan any) { |
| 646 | r, w := io.Pipe() |
| 647 | done := make(chan any) |
| 648 | |
| 649 | go e.provisionReadAndLog(sink, r, done) |
| 650 | return w, done |
| 651 | } |
| 652 | |
| 653 | func (e *executor) provisionReadAndLog(sink logSink, r io.Reader, done chan<- any) { |
| 654 | defer close(done) |
no test coverage detected