Fix golint errors

Add mount package to hack/.golint_failures to ignore stuttering errors.
This commit is contained in:
Travis Rhoden 2019-11-14 11:30:40 -07:00 committed by Srini Brahmaroutu
parent ac9fc13761
commit b221620e59
2 changed files with 6 additions and 0 deletions

View File

@ -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,

View File

@ -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, "\\") {