Skip to content

Commit c2fd891

Browse files
committed
fix: satisfy errcheck for join create
1 parent 6ad1b85 commit c2fd891

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

callbacks/associations.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,11 @@ func SaveAfterAssociations(create bool) func(db *gorm.DB) {
347347
}
348348

349349
if joins.Len() > 0 {
350-
db.AddError(db.Session(&gorm.Session{}).Clauses(clause.OnConflict{DoNothing: true}).Session(&gorm.Session{
350+
if err := db.AddError(db.Session(&gorm.Session{}).Clauses(clause.OnConflict{DoNothing: true}).Session(&gorm.Session{
351351
SkipHooks: db.Statement.SkipHooks,
352352
DisableNestedTransaction: true,
353-
}).Create(joins.Interface()).Error)
353+
}).Create(joins.Interface()).Error); err != nil {
354+
}
354355
}
355356
}
356357
}

0 commit comments

Comments
 (0)