diff --git a/boilingcore/output.go b/boilingcore/output.go index 78ba978e..d91f870a 100644 --- a/boilingcore/output.go +++ b/boilingcore/output.go @@ -306,6 +306,8 @@ func getLongExt(filename string) string { } func getOutputFilename(tableName string, isTest, isGo bool) string { + tableName = strings.ReplaceAll(strings.ReplaceAll(tableName, `/`, `_`), `\`, `_`) + if strings.HasPrefix(tableName, "_") { tableName = "und" + tableName } diff --git a/boilingcore/output_test.go b/boilingcore/output_test.go index a958b554..354af46a 100644 --- a/boilingcore/output_test.go +++ b/boilingcore/output_test.go @@ -122,6 +122,12 @@ func TestGetOutputFilename(t *testing.T) { IsGo: true, Expected: "hello", }, + "contains_forward_slash": { + TableName: "slash/test", + IsTest: false, + IsGo: true, + Expected: "slash_test_model", + }, "begins with underscore": { TableName: "_hello", IsTest: false,