dotenv-rs / dotenv

Library to help supply environment variables in testing and development
MIT License
566 stars 45 forks source link

dotenv fails to load .env file that include backslashes #73

Open mathroc opened 2 years ago

mathroc commented 2 years ago
A=\.
B="\."
C='\.'

Only C works. If A or B are present, the file fails to load.

Since dotenv.ok() silence the error, it's quite hard to detect. I guess it should not fail if the file is absent, so we could .expect() it and be more confident

isosphere commented 1 year ago

This was confusing - I agree that using .expect() by default is a good idea, it would have drawn me the reason why I had access to every env variable except the one with a backslash in it, which was really confusing!