chore: fix golint issues (#1396)

This commit is contained in:
Kevin Wan
2021-12-30 17:44:15 +08:00
committed by GitHub
parent b98d46bfd6
commit d6ff30a570
8 changed files with 16 additions and 31 deletions

View File

@@ -371,6 +371,7 @@ func getTableFields(table *model.Table) (map[string]*Field, error) {
return fieldM, nil
}
// GetSafeTables escapes the golang keywords from sql tables.
func GetSafeTables(tables []*parser.Table) []*parser.Table {
var list []*parser.Table
for _, t := range tables {
@@ -381,6 +382,7 @@ func GetSafeTables(tables []*parser.Table) []*parser.Table {
return list
}
// GetSafeTable escapes the golang keywords from sql table.
func GetSafeTable(table *parser.Table) *parser.Table {
table.Name = su.EscapeGolangKeyword(table.Name)
for _, c := range table.Columns {