2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 13:17:42 +00:00

ui: Inline lineWriter into StdioWrapper

This commit is contained in:
greatroar 2024-05-21 09:54:42 +02:00
parent 8898f61717
commit 7f439a9c34

View File

@ -37,14 +37,14 @@ func (w *StdioWrapper) Stderr() io.WriteCloser {
} }
type lineWriter struct { type lineWriter struct {
buf *bytes.Buffer buf bytes.Buffer
print func(string) print func(string)
} }
var _ io.WriteCloser = &lineWriter{} var _ io.WriteCloser = &lineWriter{}
func newLineWriter(print func(string)) *lineWriter { func newLineWriter(print func(string)) *lineWriter {
return &lineWriter{buf: bytes.NewBuffer(nil), print: print} return &lineWriter{print: print}
} }
func (w *lineWriter) Write(data []byte) (n int, err error) { func (w *lineWriter) Write(data []byte) (n int, err error) {