Package godotenv is a go port of the ruby dotenv library (

Examples/readme can be found on the github page at

The TL;DR is that you make a .env file that looks something like


and then in your go code you can call


and all the env vars declared in .env will be avaiable through os.Getenv("SOME_ENV_VAR")

godotenv is referenced in 1 repository