Documentation
¶
Overview ¶
Package main demonstrates using go-codex for CLI tool configuration: loading a TOML config file and overlaying environment variable overrides.
Pattern:
- Define AppConfig and configCodec once — the single source of truth for field names, types, validations, and documentation.
- Decode the config file through the codec (catches all file errors upfront).
- Apply environment variable overrides to the decoded struct.
- Re-validate the final struct (catches bad env values with the same constraints).
Run with: go run ./examples/cli-config
Click to show internal directories.
Click to hide internal directories.