Documentation
¶
Overview ¶
Package config standardizes 12-factor configuration on jessevdk/go-flags: a single options struct whose fields carry `long`/`env`/`default`/`description` tags, so the same definition drives CLI flags, environment variables, and `--help`. Nested groups use `group`/`namespace`/`env-namespace` tags (e.g. a group with env-namespace "DB" and a field with env "USER" reads DB_USER).
For local development, LoadDotenv seeds the environment from a .env file; real environment variables always take precedence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsHelp ¶
IsHelp reports whether err is the benign "help requested" error, which callers should treat as a clean exit.
func LoadDotenv ¶
LoadDotenv loads the given .env files (default ".env") into the process environment if present. Missing files are ignored, and existing environment variables are never overwritten — in production values come from the orchestrator, not a file.
func NewParser ¶
NewParser builds a go-flags parser with a deterministic env-namespace delimiter ("_") so nested env names are predictable (DB_USER, HTTP_ADDR, ...). data is typically a pointer to an options struct, optionally containing `command:`-tagged subcommands that implement flags.Commander.
Types ¶
This section is empty.