3
0
Files
corteza/tests/helpers/env.go
2019-09-30 10:20:40 +02:00

18 lines
333 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 {
print("LOADING ENV", loc)
godotenv.Load(loc)
}
}
}