mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
volume/mounts: windowsDetectMountType: rewrite using switch
Mostly for readability, and to avoid linters suggesting to move the default condition outside of the if/else. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -167,11 +167,12 @@ func windowsValidateAbsolute(p string) error {
|
||||
}
|
||||
|
||||
func windowsDetectMountType(p string) mount.Type {
|
||||
if strings.HasPrefix(p, `\\.\pipe\`) {
|
||||
switch {
|
||||
case strings.HasPrefix(p, `\\.\pipe\`):
|
||||
return mount.TypeNamedPipe
|
||||
} else if hostDirRegexp.MatchString(p) {
|
||||
case hostDirRegexp.MatchString(p):
|
||||
return mount.TypeBind
|
||||
} else {
|
||||
default:
|
||||
return mount.TypeVolume
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user