godotenv icon indicating copy to clipboard operation
godotenv copied to clipboard

Variable substitution using real environment variable fallbacks

Open nick-jones opened this issue 6 years ago • 6 comments

https://github.com/joho/godotenv/pull/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 https://github.com/joho/godotenv/pull/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?

nick-jones avatar Apr 24 '19 16:04 nick-jones

Also needing this functionality back..

andrewmclagan avatar May 29 '19 07:05 andrewmclagan

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

I created https://github.com/joho/godotenv/issues/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.

fabriciojs avatar May 26 '20 14:05 fabriciojs

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

nick-jones avatar May 26 '20 17:05 nick-jones

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!

evandam avatar Apr 14 '22 18:04 evandam

#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?

luisdavim avatar May 15 '22 00:05 luisdavim