schemaretag

package
v0.2026331.1221 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Normalize(src []byte) []byte

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.

Jump to

Keyboard shortcuts

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