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>
This commit is contained in:
Kir Kolyshkin 2020-03-13 17:01:48 -07:00
parent 39048cf656
commit 99beb2ca02
2 changed files with 10 additions and 1 deletions

View File

@ -1,18 +1,23 @@
package mount // import "github.com/docker/docker/pkg/mount"
// Deprecated: this package is not maintained and will be removed.
// Use github.com/moby/sys/mount and github.com/moby/sys/mountinfo instead.
import (
sysmount "github.com/moby/sys/mount"
"github.com/moby/sys/mountinfo"
)
// Deprecated: use github.com/moby/sys/mount instead.
//nolint:golint
var (
Mount = sysmount.Mount
ForceMount = sysmount.Mount // Deprecated: use Mount instead.
ForceMount = sysmount.Mount // a deprecated synonym
Unmount = sysmount.Unmount
RecursiveUnmount = sysmount.RecursiveUnmount
)
// Deprecated: use github.com/moby/sys/mount instead.
//nolint:golint
const (
RDONLY = sysmount.RDONLY
@ -39,15 +44,18 @@ const (
STRICTATIME = sysmount.STRICTATIME
)
// Deprecated: use github.com/moby/sys/mount instead.
//nolint:golint
var MergeTmpfsOptions = sysmount.MergeTmpfsOptions
// Deprecated: use github.com/moby/sys/mountinfo instead.
//nolint:golint
type (
FilterFunc = mountinfo.FilterFunc
Info = mountinfo.Info
)
// Deprecated: use github.com/moby/sys/mountinfo instead.
//nolint:golint
var (
Mounted = mountinfo.Mounted

View File

@ -4,6 +4,7 @@ import (
sysmount "github.com/moby/sys/mount"
)
// Deprecated: use github.com/moby/sys/mount instead.
//nolint:golint
var (
MakeMount = sysmount.MakeMount