Debian Codegraph @

commands/multiwriter.go

raw symbols SCIP
1 package commands
2
3 import (
4 "io"
5 "os"
6 )
7
8 type multiWriter struct {
9 writer io.Writer
10 fd uintptr
11 }
12
13 func newMultiWriter(f *os.File, writers ...io.Writer) *multiWriter {
14 return &multiWriter{
15 writer: io.MultiWriter(append([]io.Writer{f}, writers...)...),
16 fd: f.Fd(),
17 }
18 }
19
20 func (w *multiWriter) Write(p []byte) (n int, err error) {
21 return w.writer.Write(p)
22 }
23
24 func (w *multiWriter) Fd() uintptr {
25 return w.fd
26 }