Documentation
¶
Overview ¶
Package getbyid implements a go/analysis pass that flags repository methods named GetByID / DeleteByID / UpdateByID that do NOT accept a tenantID parameter. It is meant to run over internal/infra/postgres/* in CI so the audit pattern from F-309 cannot regress.
Accepted signatures (no diagnostic):
func (r *FooRepository) GetByID(ctx context.Context, tenantID shared.ID, id shared.ID) (...) func (r *FooRepository) GetByTenantAndID(ctx context.Context, tenantID, id shared.ID) (...)
Flagged signature (diagnostic):
func (r *FooRepository) GetByID(ctx context.Context, id shared.ID) (...)
A method can opt out by adding the directive `//getbyid:unsafe` on the line immediately above its declaration — this makes the exception grep-able and reviewable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "getbyidtenant", Doc: "flags repository GetByID/DeleteByID/UpdateByID methods missing a tenantID parameter", Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, }
Analyzer is the exported go/analysis pass.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.