mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
Enable to run build and invoke in background
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
@ -68,3 +68,24 @@ func NewChannel(w Writer) (chan *client.SolveStatus, chan struct{}) {
|
||||
}()
|
||||
return ch, done
|
||||
}
|
||||
|
||||
type tee struct {
|
||||
Writer
|
||||
ch chan *client.SolveStatus
|
||||
}
|
||||
|
||||
func (t *tee) Write(v *client.SolveStatus) {
|
||||
v2 := *v
|
||||
t.ch <- &v2
|
||||
t.Writer.Write(v)
|
||||
}
|
||||
|
||||
func Tee(w Writer, ch chan *client.SolveStatus) Writer {
|
||||
if ch == nil {
|
||||
return w
|
||||
}
|
||||
return &tee{
|
||||
Writer: w,
|
||||
ch: ch,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user