Skip to content

Commit 9f7ae7a

Browse files
committed
fix: avoid staticcheck empty branch
1 parent c2fd891 commit 9f7ae7a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

callbacks/associations.go

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

349349
if joins.Len() > 0 {
350-
if err := db.AddError(db.Session(&gorm.Session{}).Clauses(clause.OnConflict{DoNothing: true}).Session(&gorm.Session{
350+
db.Error = 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); err != nil {
354-
}
353+
}).Create(joins.Interface()).Error)
355354
}
356355
}
357356
}

0 commit comments

Comments
 (0)