Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable substitution using real environment variable fallbacks #74

Open
nick-jones opened this issue Apr 24, 2019 · 6 comments · May be fixed by #227
Open

Variable substitution using real environment variable fallbacks #74

nick-jones opened this issue Apr 24, 2019 · 6 comments · May be fixed by #227

Comments

@nick-jones
Copy link

#54 introduced a change that meant substitution of variables from the real environment (i.e. not that derived from .env itself) was possible.

It looks like #58 removed this behaviour, in particular the deletion of os.LookupEnv - https://github.com/joho/godotenv/pull/58/files#diff-224f281bd0a4cfe0e7dcb394e8c7a585L299. Unfortunately it isn't clear from the PR if that was intended. Any chance someone can clarify?

@andrewmclagan
Copy link

Also needing this functionality back..

@fabriciojs
Copy link

fabriciojs commented May 26, 2020

@nick-jones @andrewmclagan well 1 year later, I had the same need in my project.

I created #102.

For now I am using https://github.com/fireworkweb/godotenv (my fork) where I returned the behaviour.

Just registering this here in case someone stumbles upon this issue and then can check the latest on this.

@nick-jones
Copy link
Author

@fabriciojs 👍 there is also #72 and #88. Unfortunately no word from @joho on this.

@evandam
Copy link

evandam commented Apr 14, 2022

Hey @fabriciojs we're looking for similar functionality, but where it is able to read environment variables from os.Getenv if the variable in the file has not been defined, like https://github.com/fireproofsocks/dotenvy/blob/main/docs/dotenv-file-format.md#interpolation-aka-variable-substitution.

Is this something that you would be able to update in your fork? (or @joho)

Thanks!

@luisdavim
Copy link

luisdavim commented May 15, 2022

#135 and #149 also relate to this.

This is clearly an issue users care about, with so many issues and PRs open regarding it.

@joho any specific reason for this not to be addressed?

@Envek Envek linked a pull request Mar 6, 2024 that will close this issue
@Envek
Copy link

Envek commented Mar 6, 2024

Also made #227 as all other pull requests got stale due to parser rewrite in version 1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants