1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-18 08:26:45 +02:00
woodpecker/vendor/github.com/mitchellh/cli/ui_writer.go
2015-09-29 18:21:17 -07:00

19 lines
340 B
Go

package cli
// UiWriter is an io.Writer implementation that can be used with
// loggers that writes every line of log output data to a Ui at the
// Info level.
type UiWriter struct {
Ui Ui
}
func (w *UiWriter) Write(p []byte) (n int, err error) {
n = len(p)
if p[n-1] == '\n' {
p = p[:n-1]
}
w.Ui.Info(string(p))
return n, nil
}