diff --git a/revid/senders.go b/revid/senders.go index a73bdaca..ce7eaec6 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -188,19 +188,6 @@ type fileSender struct { data []byte } -// Write implements io.Writer. -func (s *fileSender) Write(d []byte) (int, error) { - err := s.load(d) - if err != nil { - return 0, err - } - err = s.send() - if err != nil { - return len(d), err - } - return len(d), nil -} - func newFileSender(path string) (io.Writer, error) { f, err := os.Create(path) if err != nil { @@ -209,18 +196,11 @@ func newFileSender(path string) (io.Writer, error) { return &fileSender{file: f}, nil } -func (s *fileSender) load(d []byte) error { - s.data = d - return nil +// Write implements io.Writer. +func (s *fileSender) Write(d []byte) (int, error) { + return s.file.Write(d) } -func (s *fileSender) send() error { - _, err := s.file.Write(s.data) - return err -} - -func (s *fileSender) release() {} - func (s *fileSender) close() error { return s.file.Close() } // mtsSender implements loadSender and provides sending capability specifically