package environment import ( "log" "os" "strconv" "time" "github.com/joho/godotenv" ) var ReconnectionInterval time.Duration func Load() { err := godotenv.Load() if err != nil { log.Fatal("Error loading .env file") } if recon, err := strconv.Atoi(os.Getenv("RECONNECT_INTERVAL")); err == nil { ReconnectionInterval = time.Duration(recon) * time.Millisecond } else { log.Fatal("[AMQP]", err) } } func IsDebug() bool { return os.Getenv("DEBUG") == "true" }