From d0eb8ddc307f25436e7acf26c9658aa779b732b3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 25 Nov 2018 16:34:51 +0000 Subject: [PATCH] serve webdav: disallow on go1.8 due to dependent library changes golang.org/x/net/webdav no longer builds with go1.8 --- cmd/serve/serve.go | 4 +++- cmd/serve/webdav/webdav.go | 2 ++ cmd/serve/webdav/webdav_test.go | 2 +- cmd/serve/webdav/webdav_unsupported.go | 11 +++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 cmd/serve/webdav/webdav_unsupported.go diff --git a/cmd/serve/serve.go b/cmd/serve/serve.go index 6454f1afa..5eae2b232 100644 --- a/cmd/serve/serve.go +++ b/cmd/serve/serve.go @@ -13,7 +13,9 @@ import ( func init() { Command.AddCommand(http.Command) - Command.AddCommand(webdav.Command) + if webdav.Command != nil { + Command.AddCommand(webdav.Command) + } Command.AddCommand(restic.Command) if ftp.Command != nil { Command.AddCommand(ftp.Command) diff --git a/cmd/serve/webdav/webdav.go b/cmd/serve/webdav/webdav.go index b8c8a48c0..88fa90db9 100644 --- a/cmd/serve/webdav/webdav.go +++ b/cmd/serve/webdav/webdav.go @@ -1,3 +1,5 @@ +//+build go1.9 + package webdav import ( diff --git a/cmd/serve/webdav/webdav_test.go b/cmd/serve/webdav/webdav_test.go index 404f17f75..eb2196fa3 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 +//+build !windows,!darwin,go1.9 package webdav diff --git a/cmd/serve/webdav/webdav_unsupported.go b/cmd/serve/webdav/webdav_unsupported.go new file mode 100644 index 000000000..3e99cf300 --- /dev/null +++ b/cmd/serve/webdav/webdav_unsupported.go @@ -0,0 +1,11 @@ +// 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