Skip to content

Commit

Permalink
fix: formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
divy9881 committed May 11, 2020
1 parent a9ba042 commit d7fa4f3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,10 @@ func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) error
}

err := a.db.RunInTransaction(func(tx *pg.Tx) error {
_, err := tx.Model(&lines).OnConflict("DO NOTHING").Insert()
return err
_, err := tx.Model(&lines).
OnConflict("DO NOTHING").
Insert()
return err
})

return err
Expand All @@ -265,8 +267,9 @@ func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) err
}

err := a.db.RunInTransaction(func(tx *pg.Tx) error {
_, err := tx.Model(&lines).Delete()
return err
_, err := tx.Model(&lines).
Delete()
return err
})

return err
Expand Down

0 comments on commit d7fa4f3

Please sign in to comment.