fix: let getenv honour an explicitly-empty env var
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user