diff --git a/utils.go b/utils.go index d47065bf..a4cf0b8c 100644 --- a/utils.go +++ b/utils.go @@ -53,6 +53,10 @@ func ToDBName(name string) string { return v } + if name == "" { + return "" + } + var ( value = commonInitialismsReplacer.Replace(name) buf = bytes.NewBufferString("") diff --git a/utils_test.go b/utils_test.go index 81b8ce9d..0e88a8b7 100644 --- a/utils_test.go +++ b/utils_test.go @@ -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",