Open gaby opened 1 month ago
@gaby is it possible that you're using the global instance somewhere in the codebase?
As at v1.0.0, if you're using the global instance, you need to load with:
dotenv.Load()
If you're setting the path:
dotenv.SetConfigFile("/path/to/file")
dotenv.Load()
// then you can do dotenv.Get* anywhere in the code
@profclems All I did was update the version, and change to the code from my original post, and it throws an exception now.
The readme needs to be updated, LoadConfig()
is undefined: https://github.com/search?q=repo%3Aprofclems%2Fgo-dotenv%20LoadConfig&type=code
@profclems I have multiple global instances, but they have different names though. I'm loading multiple .env
files.
@profclems I havent been able to update to v1.0.0 since a few functions are missing.
For example
LoadConfig()
. If you look at the test, they dont even call this funcion that's mentioned in the README.See here: https://github.com/profclems/go-dotenv/blob/main/bench_test.go#L9
Using the following results in a panic: