forked from TrueCloudLab/restic
Remove unneeded byte counters
This commit is contained in:
parent
c43c94776b
commit
86f4b03730
1 changed files with 4 additions and 7 deletions
|
@ -11,22 +11,19 @@ import (
|
||||||
|
|
||||||
// StdioConn implements a net.Conn via stdin/stdout.
|
// StdioConn implements a net.Conn via stdin/stdout.
|
||||||
type StdioConn struct {
|
type StdioConn struct {
|
||||||
stdin *os.File
|
stdin *os.File
|
||||||
stdout *os.File
|
stdout *os.File
|
||||||
bytesWritten, bytesRead int
|
cmd *exec.Cmd
|
||||||
cmd *exec.Cmd
|
close sync.Once
|
||||||
close sync.Once
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StdioConn) Read(p []byte) (int, error) {
|
func (s *StdioConn) Read(p []byte) (int, error) {
|
||||||
n, err := s.stdin.Read(p)
|
n, err := s.stdin.Read(p)
|
||||||
s.bytesRead += n
|
|
||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StdioConn) Write(p []byte) (int, error) {
|
func (s *StdioConn) Write(p []byte) (int, error) {
|
||||||
n, err := s.stdout.Write(p)
|
n, err := s.stdout.Write(p)
|
||||||
s.bytesWritten += n
|
|
||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue