Przeglądaj źródła

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 <kolyshkin@gmail.com>
Kir Kolyshkin 4 lat temu
rodzic
commit
2502db66d0
2 zmienionych plików z 8 dodań i 0 usunięć
  1. 2 0
      pkg/system/rm_unix.go
  2. 6 0
      pkg/system/rm_windows.go

+ 2 - 0
pkg/system/rm.go → pkg/system/rm_unix.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 package system // import "github.com/docker/docker/pkg/system"
 
 import (

+ 6 - 0
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