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.
 
 
 
 
kratos/tool/protobuf/pkg/utils/utils.go

29 lines
398 B

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()
}