From 5896be1361bf9f3d2471f58028e2157ee2075222 Mon Sep 17 00:00:00 2001 From: "John Barton (joho)" Date: Wed, 31 Jul 2013 19:46:42 +1000 Subject: [PATCH] Add the ability to autoload the env file when you import. --- autoload/autoload.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 autoload/autoload.go diff --git a/autoload/autoload.go b/autoload/autoload.go new file mode 100644 index 0000000..5cfcea8 --- /dev/null +++ b/autoload/autoload.go @@ -0,0 +1,15 @@ +package "autoload" + +/* + You can just read the .env file on import just by doing + + import _ "github.com/joho/godotenv/autoload" + + And bob's your mother's brother +*/ + +import "github.com/joho/godotenv" + +func init() { + _ = godotenv.Load() +}