fix: getenv treats an explicitly-empty value as unset (#85)

Fixes #69

## Why
`getenv` returned the fallback whenever `os.Getenv` was empty, so an intentionally-empty env var could not override a non-empty default.

## Changes
- Use `os.LookupEnv` to distinguish unset from set-but-empty.

## Validation
- `make e2e` passes.

Reviewed-on: #85
Co-authored-by: Ben Vincent <ben@unkin.net>
Co-committed-by: Ben Vincent <ben@unkin.net>
This commit was merged in pull request #85.
This commit is contained in:
2026-07-02 22:09:09 +10:00
committed by BenVincent
parent 5261af4c63
commit c39703ed0d
+1 -1
View File
@@ -65,7 +65,7 @@ func Load() (*Config, error) {
}
func getenv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
if v, ok := os.LookupEnv(key); ok {
return v
}
return fallback