Skip to content

Commit

Permalink
fix: coredump: goctl model mysql ddl --src user_base.sql --dir . area… (
Browse files Browse the repository at this point in the history
#3777)

Co-authored-by: Kevin Wan <[email protected]>
  • Loading branch information
zzZZzzz888 and kevwan authored Dec 12, 2023
1 parent daef970 commit 4835e4f
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions tools/goctl/model/sql/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/zeromicro/ddl-parser/parser"
"github.com/zeromicro/go-zero/core/collection"

"github.com/zeromicro/go-zero/tools/goctl/model/sql/converter"
"github.com/zeromicro/go-zero/tools/goctl/model/sql/model"
"github.com/zeromicro/go-zero/tools/goctl/model/sql/util"
Expand Down Expand Up @@ -145,11 +144,7 @@ func Parse(filename, database string, strict bool) ([]*Table, error) {
}
}

var (
uniqueIndex = make(map[string][]*Field)
// Unused local variable
// normalIndex = make(map[string][]*Field)
)
uniqueIndex := make(map[string][]*Field)

for indexName, each := range uniqueKeyMap {
for _, columnName := range each {
Expand All @@ -161,13 +156,6 @@ func Parse(filename, database string, strict bool) ([]*Table, error) {
}
}

// Unused local variable
// for indexName, each := range normalKeyMap {
// for _, columnName := range each {
// normalIndex[indexName] = append(normalIndex[indexName], fieldM[columnName])
// }
// }

checkDuplicateUniqueIndex(uniqueIndex, e.Name)

list = append(list, &Table{
Expand Down

0 comments on commit 4835e4f

Please sign in to comment.