Browse code

pkg/mount: deprecate

Add a deprecation/removal notice, pointing out to appropriate
replacement packages.

I was not sure if a package-level deprecation is enough, so
I also added notices around each block.

Note that `nolint:golint` annotations are left as is, otherwise
golint complains like this:

> pkg/mount/deprecated.go:45:1: comment on exported var `MergeTmpfsOptions` should be of the form `MergeTmpfsOptions ...` (golint)
> // Deprecated: use github.com/moby/sys/mount instead.
> ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2020/03/14 09:01:48
Showing 2 changed files
... ...
@@ -1,18 +1,23 @@
1 1
 package mount // import "github.com/docker/docker/pkg/mount"
2 2
 
3
+// Deprecated: this package is not maintained and will be removed.
4
+// Use github.com/moby/sys/mount and github.com/moby/sys/mountinfo instead.
5
+
3 6
 import (
4 7
 	sysmount "github.com/moby/sys/mount"
5 8
 	"github.com/moby/sys/mountinfo"
6 9
 )
7 10
 
11
+// Deprecated: use github.com/moby/sys/mount instead.
8 12
 //nolint:golint
9 13
 var (
10 14
 	Mount            = sysmount.Mount
11
-	ForceMount       = sysmount.Mount // Deprecated: use Mount instead.
15
+	ForceMount       = sysmount.Mount // a deprecated synonym
12 16
 	Unmount          = sysmount.Unmount
13 17
 	RecursiveUnmount = sysmount.RecursiveUnmount
14 18
 )
15 19
 
20
+// Deprecated: use github.com/moby/sys/mount instead.
16 21
 //nolint:golint
17 22
 const (
18 23
 	RDONLY      = sysmount.RDONLY
... ...
@@ -39,15 +44,18 @@ const (
39 39
 	STRICTATIME = sysmount.STRICTATIME
40 40
 )
41 41
 
42
+// Deprecated: use github.com/moby/sys/mount instead.
42 43
 //nolint:golint
43 44
 var MergeTmpfsOptions = sysmount.MergeTmpfsOptions
44 45
 
46
+// Deprecated: use github.com/moby/sys/mountinfo instead.
45 47
 //nolint:golint
46 48
 type (
47 49
 	FilterFunc = mountinfo.FilterFunc
48 50
 	Info       = mountinfo.Info
49 51
 )
50 52
 
53
+// Deprecated: use github.com/moby/sys/mountinfo instead.
51 54
 //nolint:golint
52 55
 var (
53 56
 	Mounted   = mountinfo.Mounted
... ...
@@ -4,6 +4,7 @@ import (
4 4
 	sysmount "github.com/moby/sys/mount"
5 5
 )
6 6
 
7
+// Deprecated: use github.com/moby/sys/mount instead.
7 8
 //nolint:golint
8 9
 var (
9 10
 	MakeMount       = sysmount.MakeMount