Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit 50c2965

Browse files
author
Takumasa Sakao
committed
Expand variables on parseValue
1 parent 33977c2 commit 50c2965

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

godotenv.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ func parseValue(value string, envMap map[string]string) string {
291291
}
292292
}
293293

294+
// expand variables
295+
value = os.Expand(value, func(key string) string {
296+
if val, ok := envMap[key]; ok {
297+
return val
298+
}
299+
return ""
300+
})
294301
return value
295302
}
296303

0 commit comments

Comments
 (0)