godotenv icon indicating copy to clipboard operation
godotenv copied to clipboard

Variables expansion only using values from the file, not os.Getenv

Open fabriciojs opened this issue 5 years ago • 2 comments
trafficstars

Is there a particular reason for NOT falling back to os.Getenv, when a variable to be expanded within another variable in the file DO NOT exist in that file?

I saw the history on issues and the PR implementing the current expansion logic, and I guess this should be following the Ruby lib behaviour - which I am not familiar with.

So I would like to know if that makes any sense, and we could think about adding such feature to use pre-existing environment variables, or not.

BTW: thanks for the package, very helpful!

fabriciojs avatar May 25 '20 22:05 fabriciojs

To help illustrate, there is a want-to-be PR that although not polished, does implement the suggested behaviour: #103

fabriciojs avatar May 25 '20 23:05 fabriciojs

Yesterday I failed to notice there is another issue for this: https://github.com/joho/godotenv/issues/74

fabriciojs avatar May 26 '20 14:05 fabriciojs