From b221620e597d0b99a92584f82efabeaa82856738 Mon Sep 17 00:00:00 2001 From: Travis Rhoden Date: Thu, 14 Nov 2019 11:30:40 -0700 Subject: [PATCH] Fix golint errors Add mount package to hack/.golint_failures to ignore stuttering errors. --- fake_mounter.go | 3 +++ mount_helper_windows.go | 3 +++ 2 files changed, 6 insertions(+) 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, "\\") {