diff --git a/fake_mounter.go b/fake_mounter.go index 315bba6941f..d3a82f415c2 100644 --- a/fake_mounter.go +++ b/fake_mounter.go @@ -36,6 +36,7 @@ type FakeMounter struct { UnmountFunc UnmountFunc } +// UnmountFunc is a function callback to be executed during the Unmount() call. type UnmountFunc func(path string) error var _ Interface = &FakeMounter{} @@ -55,6 +56,8 @@ type FakeAction struct { FSType string // applies only to "mount" actions } +// NewFakeMounter returns a FakeMounter struct that implements Interface and is +// suitable for testing purposes. func NewFakeMounter(mps []MountPoint) *FakeMounter { return &FakeMounter{ MountPoints: mps, diff --git a/mount_helper_windows.go b/mount_helper_windows.go index 5e6b1dd9adc..516f970d282 100644 --- a/mount_helper_windows.go +++ b/mount_helper_windows.go @@ -70,6 +70,9 @@ func IsCorruptedMnt(err error) bool { return false } +// NormalizeWindowsPath makes sure the given path is a valid path on Windows +// systems by making sure all instances of `/` are replaced with `\\`, and the +// path beings with `c:` func NormalizeWindowsPath(path string) string { normalizedPath := strings.Replace(path, "/", "\\", -1) if strings.HasPrefix(normalizedPath, "\\") {