Help us shape the future of Go! Take the 2026 Go Developer Survey

mockheaderguard

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package mockheaderguard proves that the generated mock-data header describes a layout forge actually creates.

The header of every generated `src/mocks/<entity>.ts` tells a reader where its values come from. It used to say they mirror `db/fixtures` — a directory `forge project new` has never created — so a reader chasing the provenance of a fixture found nothing. The values in fact come from the project's own seed plan (codegen.SeedProjection over seedplan.Plan), whose on-disk surface is `db/seeds/`.

The guard lives in its own package, rather than beside the generator, because it asserts an agreement BETWEEN two packages: the template in internal/templates and the directory set internal/generator writes. It scaffolds a real project and checks every `db/<dir>` the header names against that project's filesystem, so the obligation is derived from what forge does rather than from a list of forbidden strings.

There is no runtime code here on purpose — the guard must never become something production code can call or disable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL