format code (#386)

This commit is contained in:
Kevin Wan
2021-01-14 13:24:24 +08:00
committed by GitHub
parent 744c18b7cb
commit eca4ed2cc0
16 changed files with 114 additions and 96 deletions

View File

@@ -1,13 +1,12 @@
package gen
import (
"regexp"
)
import "regexp"
func (g *defaultGenerator) split(source string) []string {
reg := regexp.MustCompile(createTableFlag)
index := reg.FindAllStringIndex(source, -1)
list := make([]string, 0)
for i := len(index) - 1; i >= 0; i-- {
subIndex := index[i]
if len(subIndex) == 0 {
@@ -18,5 +17,6 @@ func (g *defaultGenerator) split(source string) []string {
list = append(list, ddl)
source = source[:start]
}
return list
}