From 89b6d8907794233732c8a9fa7acf68047b591a93 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 4 Sep 2019 10:20:18 +0100 Subject: [PATCH] build: drop support for go1.9 --- cmd/serve/restic/restic.go | 3 --- cmd/serve/restic/restic_appendonly_test.go | 2 -- cmd/serve/restic/restic_privaterepos_test.go | 2 -- cmd/serve/restic/restic_test.go | 2 -- cmd/serve/restic/restic_unsupported.go | 11 -------- cmd/serve/restic/restic_utils_test.go | 2 -- cmd/serve/restic/stdio_conn.go | 23 +++++++++++++++-- cmd/serve/restic/stdio_conn_go1.10.go | 27 -------------------- cmd/serve/restic/stdio_conn_pre_go1.10.go | 22 ---------------- cmd/serve/webdav/webdav.go | 3 +-- cmd/serve/webdav/webdav_test.go | 2 +- cmd/serve/webdav/webdav_unsupported.go | 11 -------- fs/versioncheck.go | 6 ++--- 13 files changed, 26 insertions(+), 90 deletions(-) delete mode 100644 cmd/serve/restic/restic_unsupported.go delete mode 100644 cmd/serve/restic/stdio_conn_go1.10.go delete mode 100644 cmd/serve/restic/stdio_conn_pre_go1.10.go delete mode 100644 cmd/serve/webdav/webdav_unsupported.go diff --git a/cmd/serve/restic/restic.go b/cmd/serve/restic/restic.go index bbb931331..9d77ee18e 100644 --- a/cmd/serve/restic/restic.go +++ b/cmd/serve/restic/restic.go @@ -1,7 +1,4 @@ // Package restic serves a remote suitable for use with restic - -// +build go1.9 - package restic import ( diff --git a/cmd/serve/restic/restic_appendonly_test.go b/cmd/serve/restic/restic_appendonly_test.go index 90256a53c..8658fab95 100644 --- a/cmd/serve/restic/restic_appendonly_test.go +++ b/cmd/serve/restic/restic_appendonly_test.go @@ -1,5 +1,3 @@ -// +build go1.9 - package restic import ( diff --git a/cmd/serve/restic/restic_privaterepos_test.go b/cmd/serve/restic/restic_privaterepos_test.go index a04e737ae..61e7864de 100644 --- a/cmd/serve/restic/restic_privaterepos_test.go +++ b/cmd/serve/restic/restic_privaterepos_test.go @@ -1,5 +1,3 @@ -// +build go1.9 - package restic import ( diff --git a/cmd/serve/restic/restic_test.go b/cmd/serve/restic/restic_test.go index e18ed8d22..bd3bc7cf1 100644 --- a/cmd/serve/restic/restic_test.go +++ b/cmd/serve/restic/restic_test.go @@ -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 ( diff --git a/cmd/serve/restic/restic_unsupported.go b/cmd/serve/restic/restic_unsupported.go deleted file mode 100644 index 892334116..000000000 --- a/cmd/serve/restic/restic_unsupported.go +++ /dev/null @@ -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 diff --git a/cmd/serve/restic/restic_utils_test.go b/cmd/serve/restic/restic_utils_test.go index 4ccc49b06..0721f7c0f 100644 --- a/cmd/serve/restic/restic_utils_test.go +++ b/cmd/serve/restic/restic_utils_test.go @@ -1,5 +1,3 @@ -// +build go1.9 - package restic import ( diff --git a/cmd/serve/restic/stdio_conn.go b/cmd/serve/restic/stdio_conn.go index 6c82f1c68..3b411eb0e 100644 --- a/cmd/serve/restic/stdio_conn.go +++ b/cmd/serve/restic/stdio_conn.go @@ -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) +} diff --git a/cmd/serve/restic/stdio_conn_go1.10.go b/cmd/serve/restic/stdio_conn_go1.10.go deleted file mode 100644 index 97c108991..000000000 --- a/cmd/serve/restic/stdio_conn_go1.10.go +++ /dev/null @@ -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) -} diff --git a/cmd/serve/restic/stdio_conn_pre_go1.10.go b/cmd/serve/restic/stdio_conn_pre_go1.10.go deleted file mode 100644 index 9769230ef..000000000 --- a/cmd/serve/restic/stdio_conn_pre_go1.10.go +++ /dev/null @@ -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 -} diff --git a/cmd/serve/webdav/webdav.go b/cmd/serve/webdav/webdav.go index c3ce6d8b2..16610768f 100644 --- a/cmd/serve/webdav/webdav.go +++ b/cmd/serve/webdav/webdav.go @@ -1,5 +1,4 @@ -//+build go1.9 - +// Package webdav implements a WebDAV server backed by rclone VFS package webdav import ( diff --git a/cmd/serve/webdav/webdav_test.go b/cmd/serve/webdav/webdav_test.go index 61fcd829e..9c119a835 100644 --- a/cmd/serve/webdav/webdav_test.go +++ b/cmd/serve/webdav/webdav_test.go @@ -3,7 +3,7 @@ // // We skip tests on platforms with troublesome character mappings -//+build !windows,!darwin,go1.9 +//+build !windows,!darwin package webdav diff --git a/cmd/serve/webdav/webdav_unsupported.go b/cmd/serve/webdav/webdav_unsupported.go deleted file mode 100644 index 3e99cf300..000000000 --- a/cmd/serve/webdav/webdav_unsupported.go +++ /dev/null @@ -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 diff --git a/fs/versioncheck.go b/fs/versioncheck.go index 03af486ea..b2f8c7191 100644 --- a/fs/versioncheck.go +++ b/fs/versioncheck.go @@ -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() }