You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
376 B
Go
19 lines
376 B
Go
package generator
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/tal-tech/go-zero/tools/goctl/util/stringx"
|
|
)
|
|
|
|
func formatFilename(filename string, style NamingStyle) string {
|
|
switch style {
|
|
case namingCamel:
|
|
return stringx.From(filename).ToCamel()
|
|
case namingSnake:
|
|
return stringx.From(filename).ToSnake()
|
|
default:
|
|
return strings.ToLower(stringx.From(filename).ToCamel())
|
|
}
|
|
}
|