3
0
2019-10-16 19:12:11 +02:00

17 lines
304 B
Go

package helpers
import (
"os"
"github.com/joho/godotenv"
)
// RecursiveDotEnvLoad loads ENV variables from .evn files 3 levels down
func RecursiveDotEnvLoad() {
for _, loc := range []string{".env", "../.env", "../../.env"} {
if _, err := os.Stat(loc); err == nil {
godotenv.Load(loc)
}
}
}