Skip to content

Commit 8d1e456

Browse files
committed
...
1 parent 6cbf92d commit 8d1e456

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

internal/codegen/golang/result.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,14 @@ func newGoEmbed(req *plugin.CodeGenRequest, tableName string, embed *plugin.Iden
140140

141141
structName := s.Name
142142

143-
if tableName != s.Table.Name && !req.Settings.Go.EmitExactTableNames {
144-
structName = inflection.Singular(inflection.SingularParams{
145-
Name: tableName,
146-
Exclusions: req.Settings.Go.InflectionExcludeTableNames,
147-
})
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+
}
148151
}
149152

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

0 commit comments

Comments
 (0)