Encode the required fail-fast behavior as tests ahead of the implementation: a config value that is SET but unparseable or invalid must abort startup (defaults apply only to OMITTED keys), unknown top-level keys and unknown metrics subkeys must abort naming the key, a malformed config file at a standard location must abort instead of being skipped with a warning, and state_dir must be creatable and writable at startup. Mechanically extracts newFromSmartConfig from config.New so the construction path is testable without fx; current lenient behavior is unchanged, so the new enforcement tests fail.
6.4 KiB
6.4 KiB