Skip to content

Commit 3250847

Browse files
committed
simplify
1 parent 529a8a1 commit 3250847

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/codegen/golang/result.go

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

141+
fields := make([]Field, len(s.Fields))
142+
copy(fields, s.Fields)
143+
141144
structName := tableName
142145
if !req.Settings.Go.EmitExactTableNames {
143146
structName = inflection.Singular(inflection.SingularParams{
@@ -146,9 +149,6 @@ func newGoEmbed(req *plugin.CodeGenRequest, tableName string, embed *plugin.Iden
146149
})
147150
}
148151

149-
fields := make([]Field, len(s.Fields))
150-
copy(fields, s.Fields)
151-
152152
return &goEmbed{
153153
modelType: s.Name,
154154
modelName: structName,

0 commit comments

Comments
 (0)