1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 08:16:36 +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) {