allan2 / dotenvy

A well-maintained fork of the Rust dotenv crate
MIT License
625 stars 39 forks source link

Allow dotenv macro to provide a default value #67

Closed Vrixyz closed 1 year ago

Vrixyz commented 1 year ago

My use case is:

This PR adds a try_dotenv!("env_key", "default value") which does not create a compilation error if the second parameter is correct.

Vrixyz commented 1 year ago

actually, dotenv! already does that, but I need to create a .env file to bypass compilation, I'm closing this as the workaround to create a ".env" is good enough for me.