Remove all workarounds for Go < 1.11

This commit is contained in:
Alexander Neumann 2020-02-26 20:29:36 +01:00
parent 2464f7c4d1
commit 99fd80a585
7 changed files with 23 additions and 79 deletions

View file

@ -5,6 +5,7 @@ import (
"os"
"os/exec"
"sync"
"time"
"github.com/restic/restic/internal/debug"
)
@ -58,6 +59,26 @@ func (s *StdioConn) RemoteAddr() net.Addr {
return Addr{}
}
// SetDeadline sets the read/write deadline.
func (s *StdioConn) SetDeadline(t time.Time) error {
err1 := s.stdin.SetReadDeadline(t)
err2 := s.stdout.SetWriteDeadline(t)
if err1 != nil {
return err1
}
return err2
}
// SetReadDeadline sets the read/write deadline.
func (s *StdioConn) SetReadDeadline(t time.Time) error {
return s.stdin.SetReadDeadline(t)
}
// SetWriteDeadline sets the read/write deadline.
func (s *StdioConn) SetWriteDeadline(t time.Time) error {
return s.stdout.SetWriteDeadline(t)
}
// make sure StdioConn implements net.Conn
var _ net.Conn = &StdioConn{}