Environment variables are unaffected by Delete, making it misleading —
callers would expect a key to be fully gone but env vars would still
resolve. Sub is the better abstraction for scoped config.
- Add Delete(key) to remove keys from all config layers
- Add Sub(key) to get a scoped ConfigManager for nested sections
- Update CodeQL workflow actions to v4/v5/v3
- Update govulncheck workflow checkout to v4
- Remove boilerplate comments from CodeQL workflow
- Add comprehensive tests for both new methods
- Update README with Sub() usage example and API docs
- collapse() now applies env vars for keys present in fileConfig, not
just defaultConfig. Previously, env vars couldn't override file values
unless a default was also set for that key.
- SetDefault no longer pollutes overrideConfig; it correctly resolves
the value by checking override > env > file > default.
- Remove unused explicitDefaults field and UseExplicitDefaults method.
- Add IsSet, AllKeys, AllSettings methods + package-level wrappers.
- Add missing package-level wrappers: Get, SetBool, SetString,
SetConfigDir, WithEnvPrefix.
- Add tests for all new methods and the env-over-file-without-default
fix.
The documented precedence is Set > env > file > defaults, but collapse()
was using maps.Copy(ccm, mapConfig) which let file values (and Set values,
stored in the same map) unconditionally overwrite env values.
Split mapConfig into fileConfig (from ReadInConfig) and overrideConfig
(from Set/SetString/SetBool). collapse() now applies layers in correct
order: defaults, then file, then env (for known keys), then overrides.
Added TestPrecedenceChain to verify the full layering.