2015-02-07 15:49:09 +00:00
|
|
|
// +build windows
|
|
|
|
|
2018-01-12 16:30:54 +00:00
|
|
|
package driveletter
|
2015-02-07 15:49:09 +00:00
|
|
|
|
2018-01-12 16:30:54 +00:00
|
|
|
// IsDriveLetter returns a bool indicating whether name is a valid
|
2015-02-07 15:49:09 +00:00
|
|
|
// Windows drive letter
|
2018-01-12 16:30:54 +00:00
|
|
|
func IsDriveLetter(name string) bool {
|
2015-02-07 15:49:09 +00:00
|
|
|
if len(name) != 1 {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
c := name[0]
|
|
|
|
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|
|
|
|
}
|