Open HimanshuJha2000 opened 1 year ago
The same problem I have.
I want to set env_A="abc", and env_B="${env_A}_123".
But godotenv gives me env_B="\${env_A}_123", the variable syntax is not compatible.
Code like:
envMap, _ := godotenv.Read("some_file")
envMap["env_A"] = "abc"
_ = godotenv.Write(envMap, d.envFile)
envMap["env_B"] = "${env_A}_123"
_ = godotenv.Write(envMap, d.envFile)
and run cat some_file
shows:
env_A="abc"
env_B="\${env_A}_123"
We have a usecase where we let user give their environment variables which we write to a env file using this package, that file will be sent to docker as an env file. While seeing the logs, I observe that I'm getting double quotes over values of env variables due to which the script which I mounted on my docker I've to assume that double quotes have been added to the values of env variables there as well . On debugging through this package, saw this line
Where we're adding double quotes over the values in map while appending to the file. Not sure if it's a bug or is being done in this way for some purpose. As of now I move to a different package but want to move back to this package only. Can you please help me with this?