From d7233a52baf15526653beadf7271255733f5148f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 21 Jul 2024 10:27:59 -0400 Subject: [PATCH] added godotenv to load env variables --- main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 00f5025..f31e607 100644 --- a/main.go +++ b/main.go @@ -2,12 +2,20 @@ package main import ( "embed" - + "github.com/joho/godotenv" "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "log" ) +func init() { + err := godotenv.Load() + if err != nil { + log.Fatal("Error loading .env file") + } +} + //go:embed all:frontend/dist var assets embed.FS