1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-12 02:28:05 +02:00
kratos/tool/protobuf/pkg/utils/utils.go
Tony e5fe1e4f63 Kratos protobuf protoc (#71)
* add cross-platform protoc
* add protobuf generator
2019-05-05 20:33:09 +08:00

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