mirror of
https://github.com/taigrr/jety.git
synced 2026-04-02 03:19:03 -07:00
SetEnvPrefix was broken: it set the prefix string but never re-read environment variables. This meant collapse() and SetDefault() couldn't match prefixed env vars to their unprefixed config keys, so defaults always won over env vars. The fix makes SetEnvPrefix behave identically to WithEnvPrefix: it re-reads os.Environ(), strips the prefix from matching keys, and stores the stripped keys in envConfig. The envPrefix field is removed entirely since keys are always pre-stripped. BREAKING CHANGE: SetEnvPrefix now filters env vars to only those matching the prefix (previously all env vars were accessible). This matches the documented and expected behavior.
6.2 KiB
6.2 KiB