Skip to content

Commit 529a8a1

Browse files
committed
simplify
1 parent 8d1e456 commit 529a8a1

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

internal/codegen/golang/result.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,12 @@ func newGoEmbed(req *plugin.CodeGenRequest, tableName string, embed *plugin.Iden
138138
continue
139139
}
140140

141-
structName := s.Name
142-
143-
if tableName != s.Table.Name {
144-
structName = tableName
145-
if !req.Settings.Go.EmitExactTableNames {
146-
structName = inflection.Singular(inflection.SingularParams{
147-
Name: structName,
148-
Exclusions: req.Settings.Go.InflectionExcludeTableNames,
149-
})
150-
}
141+
structName := tableName
142+
if !req.Settings.Go.EmitExactTableNames {
143+
structName = inflection.Singular(inflection.SingularParams{
144+
Name: structName,
145+
Exclusions: req.Settings.Go.InflectionExcludeTableNames,
146+
})
151147
}
152148

153149
fields := make([]Field, len(s.Fields))

0 commit comments

Comments
 (0)