fix SingularTable

This commit is contained in:
谢小军
2020-02-21 02:16:16 +08:00
parent 80351c3d64
commit 6b14d480f0
4 changed files with 9 additions and 5 deletions

View File

@@ -135,8 +135,12 @@ func (s *GenStruct) Generates() []string {
}
p.Add(s.Notes)
p.Add("type", s.Name, "struct {")
mp := make(map[string]bool, len(s.Em))
for _, v := range s.Em {
p.Add(v.Generate())
if !mp[v.Name] {
mp[v.Name] = true
p.Add(v.Generate())
}
}
p.Add("}")