build: drop support for go1.9

This commit is contained in:
Nick Craig-Wood 2019-09-04 10:20:18 +01:00
parent ef7b001626
commit 89b6d89077
13 changed files with 26 additions and 90 deletions

View File

@ -1,7 +1,4 @@
// Package restic serves a remote suitable for use with restic
// +build go1.9
package restic
import (

View File

@ -1,5 +1,3 @@
// +build go1.9
package restic
import (

View File

@ -1,5 +1,3 @@
// +build go1.9
package restic
import (

View File

@ -1,8 +1,6 @@
// Serve restic tests set up a server and run the integration tests
// for restic against it.
// +build go1.9
package restic
import (

View File

@ -1,11 +0,0 @@
// Build for unsupported platforms to stop go complaining
// about "no buildable Go source files "
// +build !go1.9
package restic
import "github.com/spf13/cobra"
// Command definition is nil to show not implemented
var Command *cobra.Command = nil

View File

@ -1,5 +1,3 @@
// +build go1.9
package restic
import (

View File

@ -1,10 +1,9 @@
// +build go1.9
package restic
import (
"net"
"os"
"time"
)
// Addr implements net.Addr for stdin/stdout.
@ -52,3 +51,23 @@ func (s *StdioConn) LocalAddr() net.Addr {
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)
}

View File

@ -1,27 +0,0 @@
//+build go1.10
// Deadline setting for go1.10+
package restic
import "time"
// 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)
}

View File

@ -1,22 +0,0 @@
//+build go1.9,!go1.10
// Fallback deadline setting for pre go1.10
package restic
import "time"
// SetDeadline sets the read/write deadline.
func (s *StdioConn) SetDeadline(t time.Time) error {
return nil
}
// SetReadDeadline sets the read/write deadline.
func (s *StdioConn) SetReadDeadline(t time.Time) error {
return nil
}
// SetWriteDeadline sets the read/write deadline.
func (s *StdioConn) SetWriteDeadline(t time.Time) error {
return nil
}

View File

@ -1,5 +1,4 @@
//+build go1.9
// Package webdav implements a WebDAV server backed by rclone VFS
package webdav
import (

View File

@ -3,7 +3,7 @@
//
// We skip tests on platforms with troublesome character mappings
//+build !windows,!darwin,go1.9
//+build !windows,!darwin
package webdav

View File

@ -1,11 +0,0 @@
// Build for webdav for unsupported platforms to stop go complaining
// about "no buildable Go source files "
// +build !go1.9
package webdav
import "github.com/spf13/cobra"
// Command definition is nil to show not implemented
var Command *cobra.Command = nil

View File

@ -1,7 +1,7 @@
//+build !go1.9
//+build !go1.10
package fs
// Upgrade to Go version 1.9 to compile rclone - latest stable go
// Upgrade to Go version 1.10 to compile rclone - latest stable go
// compiler recommended.
func init() { Go_version_1_9_required_for_compilation() }
func init() { Go_version_1_10_required_for_compilation() }