forked from mirror/gorm
Don't panic with ToDbName
This commit is contained in:
parent
67874f9232
commit
4351917c45
4
utils.go
4
utils.go
|
@ -53,6 +53,10 @@ func ToDBName(name string) string {
|
|||
return v
|
||||
}
|
||||
|
||||
if name == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
var (
|
||||
value = commonInitialismsReplacer.Replace(name)
|
||||
buf = bytes.NewBufferString("")
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
func TestToDBNameGenerateFriendlyName(t *testing.T) {
|
||||
var maps = map[string]string{
|
||||
"": "",
|
||||
"ThisIsATest": "this_is_a_test",
|
||||
"PFAndESI": "pf_and_esi",
|
||||
"AbcAndJkl": "abc_and_jkl",
|
||||
|
|
Loading…
Reference in New Issue