Skip to content

Commit

Permalink
Declare err variable in InsertRel generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenafamo committed Oct 17, 2024
1 parent e0aad95 commit 03b0125
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gen/templates/models/11_rel_ops.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@
return nil
}

var err error

{{if $rel.InsertEarly -}}
inserted, err := {{$ftable.UpPlural}}.InsertMany(ctx, exec, related...)
if err != nil {
Expand Down

0 comments on commit 03b0125

Please sign in to comment.