mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-12 02:28:05 +02:00
e5fe1e4f63
* add cross-platform protoc * add protobuf generator
30 lines
398 B
Go
30 lines
398 B
Go
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()
|
|
}
|