Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ucatbas committed Oct 31, 2024
1 parent a6abc32 commit f011909
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions internal/engines/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ func (engine *CheckEngine) checkDirectRelation(request *base.PermissionCheckRequ
// TupleFilter helps in filtering out the relationships for a specific entity and a permission.
var rit *database.TupleIterator
rit, err = engine.dataReader.QueryRelationships(ctx, request.GetTenantId(), filter, request.GetMetadata().GetSnapToken(), database.NewCursorPagination())

// If there's an error in querying, return a denied permission response along with the error.
if err != nil {
return denied(emptyResponseMetadata()), err
Expand Down Expand Up @@ -466,7 +465,6 @@ func (engine *CheckEngine) checkDirectAttribute(
// storageContext.NewContextualAttributes creates a new instance of ContextualAttributes based on the attributes
// retrieved from the request context.
val, err = storageContext.NewContextualAttributes(request.GetContext().GetAttributes()...).QuerySingleAttribute(filter)

// An error occurred while querying the single attribute, so we return a denied response with empty metadata
// and the error.
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion internal/engines/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ func (engine *ExpandEngine) expandDirectAttribute(

// Attempt to get the attribute using the defined filter.
val, err = storageContext.NewContextualAttributes(request.GetContext().GetAttributes()...).QuerySingleAttribute(filter)

// If there's an error in getting the attribute, send a failure response through the channel and return from the function.
if err != nil {
expandChan <- expandFailResponse(err)
Expand Down
1 change: 0 additions & 1 deletion internal/engines/subjectFilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ func (engine *SubjectFilter) subjectFilterDirectAttribute(
// storageContext.NewContextualAttributes creates a new instance of ContextualAttributes based on the attributes
// retrieved from the request context.
val, err = storageContext.NewContextualAttributes(request.GetContext().GetAttributes()...).QuerySingleAttribute(filter)

// An error occurred while querying the single attribute, so we return a denied response with empty metadata
// and the error.
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion internal/storage/postgres/tenantWriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func (w *TenantWriter) DeleteTenant(ctx context.Context, tenantID string) (resul
var name string
var createdAt time.Time
err = br.QueryRow().Scan(&name, &createdAt)

if err != nil {
if totalDeleted > 0 {
name = fmt.Sprintf("Affected rows: %d", totalDeleted)
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ func serve() func(cmd *cobra.Command, args []string) error {
headers,
cfg.Meter.Protocol,
)

if err != nil {
slog.Error(err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion pkg/database/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ func createPools(ctx context.Context, wConfig, rConfig *pgxpool.Config) (*pgxpoo
}
return nil
}, retryPolicy)

// Handle errors from pinging
if err != nil {
writePool.Close()
Expand Down

0 comments on commit f011909

Please sign in to comment.