fix: let getenv honour an explicitly-empty env var
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

getenv fell back to the default whenever os.Getenv returned empty, so an
intentionally-empty override was impossible. Use os.LookupEnv to
distinguish unset from empty.

Refs #69
This commit is contained in:
2026-07-02 00:28:40 +10:00
parent 8d9bc1c422
commit 1bed296c35
+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