mirror of
https://github.com/joho/godotenv.git
synced 2025-04-27 13:12:49 +00:00
Merge pull request #8 from calavera/add_values_to_envmap
Fix issue reading file.
This commit is contained in:
commit
ead2e75027
@ -104,8 +104,10 @@ func loadFile(filename string) (err error) {
|
||||
}
|
||||
|
||||
for key, value := range envMap {
|
||||
if os.Getenv(key) == "" {
|
||||
os.Setenv(key, value)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
@ -129,7 +131,7 @@ func readFile(filename string) (envMap map[string]string, err error) {
|
||||
if !isIgnoredLine(fullLine) {
|
||||
key, value, err := parseLine(fullLine)
|
||||
|
||||
if err == nil && os.Getenv(key) == "" {
|
||||
if err == nil {
|
||||
envMap[key] = value
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user