From 2502db66d0ddf789aa1d09f739db5f2add80916b Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 21 Sep 2020 01:21:24 -0700 Subject: [PATCH] pkg/system: make EnsureRemoveAll unix-specific The tricks performed by EnsureRemoveAll only make sense for Linux and other Unices, so separate it out, and make EnsureRemoveAll for Windows just an alias of os.RemoveAll. This makes sure RecursiveUnmount is not called on Windows. Signed-off-by: Kir Kolyshkin --- pkg/system/{rm.go => rm_unix.go} | 2 ++ pkg/system/rm_windows.go | 6 ++++++ 2 files changed, 8 insertions(+) rename pkg/system/{rm.go => rm_unix.go} (98%) create mode 100644 pkg/system/rm_windows.go diff --git a/pkg/system/rm.go b/pkg/system/rm_unix.go similarity index 98% rename from pkg/system/rm.go rename to pkg/system/rm_unix.go index 9e251dc153..6ba3fb3ae8 100644 --- a/pkg/system/rm.go +++ b/pkg/system/rm_unix.go @@ -1,3 +1,5 @@ +// +build !windows + package system // import "github.com/docker/docker/pkg/system" import ( diff --git a/pkg/system/rm_windows.go b/pkg/system/rm_windows.go new file mode 100644 index 0000000000..ed9c5dcb8a --- /dev/null +++ b/pkg/system/rm_windows.go @@ -0,0 +1,6 @@ +package system + +import "os" + +// EnsureRemoveAll is an alias to os.RemoveAll on Windows +var EnsureRemoveAll = os.RemoveAll