mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
15 lines
353 B
Go
15 lines
353 B
Go
//go:build windows
|
|
|
|
// Package driveletter returns whether a name is a valid drive letter
|
|
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')
|
|
}
|