Documentation
¶
Overview ¶
Package main shows how to use Codec.Validate and Format.Validate for explicit bidirectional validation.
By design, go-codex only validates in the decode direction — constraints guard external input (JSON, YAML, TOML) that you don't control. The encode direction is trusted: you constructed the value yourself.
When you need to validate a Go value you constructed (e.g. before storing it, or after building it programmatically), call Validate explicitly. It reuses the exact same Refine constraints — no duplication needed.
Click to show internal directories.
Click to hide internal directories.