joho / godotenv

A Go port of Ruby's dotenv library (Loads environment variables from .env files)
http://godoc.org/github.com/joho/godotenv
MIT License
8.49k stars 405 forks source link

dotenv does not report an error if file does not exist #192

Open maffka123 opened 2 years ago

maffka123 commented 2 years ago

Hi,

Is there any particular reason why there is no return err here godotenv.go line 71 in Overload()

Like that it silently fails if it cannot find a file..

BigBallard commented 2 years ago

@maffka123 that is not really an error though. Most other dotenv implementations in other languages do not expose an error when the file is not found. However, if you feel this is worth doing, go ahead and do a PR with those changes. Should be pretty easy.

Edit Rather, just fork, this repo is effectively done.

egasimov commented 1 year ago

@maffka123 , it looks like similar issue described here
I've just made two PRs for resolving the issue you mentioned before with different approaches, it is still in pending because of repo is effectively done.

You may check them. PR-1 , PR-2