Files
Kevin Minehart 13f4cf162e CI: move grafana-build into pkg/build (#105640)
* move grafana-build into pkg/build
2025-05-20 10:48:00 -05:00

30 lines
388 B
Go

package pipelines
import (
"io"
"os"
"sync"
)
type SyncWriter struct {
Writer io.Writer
mutex *sync.Mutex
}
func NewSyncWriter(w io.Writer) *SyncWriter {
return &SyncWriter{
Writer: w,
mutex: &sync.Mutex{},
}
}
func (w *SyncWriter) Write(b []byte) (int, error) {
w.mutex.Lock()
defer w.mutex.Unlock()
return w.Writer.Write(b)
}
var Stdout = NewSyncWriter(os.Stdout)