Remove deadcode

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-13 16:50:35 +01:00
parent 7fd4221199
commit ef76a8d2e1
76 changed files with 137 additions and 4424 deletions

View File

@@ -95,78 +95,6 @@ WHERE
return err
}
func (cos *ControlObligations) LoadByControlID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
controlID gid.GID,
) error {
q := `
SELECT
control_id,
obligation_id,
created_at
FROM
controls_obligations
WHERE
%s
AND control_id = @control_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"control_id": controlID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query control_obligations: %w", err)
}
controlObligations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ControlObligation])
if err != nil {
return fmt.Errorf("cannot collect control_obligations: %w", err)
}
*cos = controlObligations
return nil
}
func (cos *ControlObligations) LoadByObligationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
obligationID gid.GID,
) error {
q := `
SELECT
control_id,
obligation_id,
created_at
FROM
controls_obligations
WHERE
%s
AND obligation_id = @obligation_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"obligation_id": obligationID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query control_obligations: %w", err)
}
controlObligations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ControlObligation])
if err != nil {
return fmt.Errorf("cannot collect control_obligations: %w", err)
}
*cos = controlObligations
return nil
}
func (cos *ControlObligations) CountByControlID(
ctx context.Context,
conn pg.Conn,