From 303998796847281cf6bcf972dbf1a65c5452b80b Mon Sep 17 00:00:00 2001 From: Timothy Date: Fri, 8 Sep 2017 16:19:28 +0800 Subject: [PATCH] bug fix for env file --- utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.go b/utils.go index 485efd8..4964405 100644 --- a/utils.go +++ b/utils.go @@ -51,13 +51,14 @@ func getExecutePath() string { func loadEnv() { exPath := getExecutePath() + envPath := fmt.Sprintf("%s/.env", exPath) // if .env file doesn't exist, just return if _, err := os.Stat(fmt.Sprintf("%s/.env", exPath)); os.IsNotExist(err) { return } - err := godotenv.Load() + err := godotenv.Load(envPath) if err != nil { log.Fatal("Error loading .env file") return