mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Fix golint errors
Add mount package to hack/.golint_failures to ignore stuttering errors.
This commit is contained in:
parent
ac9fc13761
commit
b221620e59
@ -36,6 +36,7 @@ type FakeMounter struct {
|
|||||||
UnmountFunc UnmountFunc
|
UnmountFunc UnmountFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnmountFunc is a function callback to be executed during the Unmount() call.
|
||||||
type UnmountFunc func(path string) error
|
type UnmountFunc func(path string) error
|
||||||
|
|
||||||
var _ Interface = &FakeMounter{}
|
var _ Interface = &FakeMounter{}
|
||||||
@ -55,6 +56,8 @@ type FakeAction struct {
|
|||||||
FSType string // applies only to "mount" actions
|
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 {
|
func NewFakeMounter(mps []MountPoint) *FakeMounter {
|
||||||
return &FakeMounter{
|
return &FakeMounter{
|
||||||
MountPoints: mps,
|
MountPoints: mps,
|
||||||
|
@ -70,6 +70,9 @@ func IsCorruptedMnt(err error) bool {
|
|||||||
return false
|
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 {
|
func NormalizeWindowsPath(path string) string {
|
||||||
normalizedPath := strings.Replace(path, "/", "\\", -1)
|
normalizedPath := strings.Replace(path, "/", "\\", -1)
|
||||||
if strings.HasPrefix(normalizedPath, "\\") {
|
if strings.HasPrefix(normalizedPath, "\\") {
|
||||||
|
Loading…
Reference in New Issue
Block a user