aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/mitchellh/cli/ui_writer.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitchellh/cli/ui_writer.go')
-rw-r--r--vendor/github.com/mitchellh/cli/ui_writer.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/mitchellh/cli/ui_writer.go b/vendor/github.com/mitchellh/cli/ui_writer.go
new file mode 100644
index 0000000..1e1db3c
--- /dev/null
+++ b/vendor/github.com/mitchellh/cli/ui_writer.go
@@ -0,0 +1,18 @@
1package cli
2
3// UiWriter is an io.Writer implementation that can be used with
4// loggers that writes every line of log output data to a Ui at the
5// Info level.
6type UiWriter struct {
7 Ui Ui
8}
9
10func (w *UiWriter) Write(p []byte) (n int, err error) {
11 n = len(p)
12 if n > 0 && p[n-1] == '\n' {
13 p = p[:n-1]
14 }
15
16 w.Ui.Info(string(p))
17 return n, nil
18}