Documentation
¶
Overview ¶
Package schemaretag is THE single struct-tag normalization contract for the schema→Go pipeline (R3).
The params generator emits json tags only, but every committed `cue_types_gen.go` in this org carries yaml tags too — so the generation pipeline has a THIRD step after concatenation (`schemaconcat`) and generation (`schemaparams`): normalize the struct tags, doubling every json tag with a yaml tag of the same name and giving a bare yaml key `,omitempty`.
That step used to live only inside `schemagen`, which no other module may import (Go's internal rule) — which is why a charly-native regeneration verb could not reuse it, and why the recipe had to be published as checkout-relative shell. It lives here now: `schemaparams` calls THIS, and the `charly`-side generation verb reaches it through `schemaparams`, so a generated file can never depend on which of them produced it.
STANDALONE: depends only on the stdlib `regexp`, so its caller can import it without pulling in the packages it regenerates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize rewrites a gengotypes-generated Go file's struct tags: every json-only tag gains a yaml tag of the same name, and every bare yaml key gains `,omitempty`. It is idempotent, and it touches nothing but those two tag forms — so a caller can normalize a generated file repeatedly without churn.
Types ¶
This section is empty.