azote-backend/initializers/loadEnv.go

18 lines
228 B
Go

package initializers
import (
"log"
"os"
"github.com/joho/godotenv"
)
func LoadEnv() {
if os.Getenv("GIN_MODE") != "release" {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file!")
}
}
}