You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
398 B
30 lines
398 B
6 years ago
|
package utils
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"unicode"
|
||
|
)
|
||
|
|
||
|
// LcFirst lower the first letter
|
||
|
func LcFirst(str string) string {
|
||
|
for i, v := range str {
|
||
|
return string(unicode.ToLower(v)) + str[i+1:]
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
func IsDir(name string) bool {
|
||
|
file, err := os.Open(name)
|
||
|
|
||
|
if err != nil {
|
||
|
return false
|
||
|
}
|
||
|
defer file.Close()
|
||
|
|
||
|
fi, err := file.Stat()
|
||
|
if err != nil {
|
||
|
return false
|
||
|
}
|
||
|
return fi.IsDir()
|
||
|
}
|