1
mirror of https://github.com/rclone/rclone synced 2024-12-28 21:03:45 +01:00
rclone/fs/driveletter/driveletter_windows.go
2021-09-09 20:43:59 +03:00

15 lines
301 B
Go

//go:build windows
// +build windows
package driveletter
// IsDriveLetter returns a bool indicating whether name is a valid
// Windows drive letter
func IsDriveLetter(name string) bool {
if len(name) != 1 {
return false
}
c := name[0]
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
}