diff --git a/main.go b/main.go index a7e558d..af1ab3b 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,8 @@ import ( "net/http" "os" "os/exec" + "path/filepath" + "runtime" "strings" ) @@ -20,7 +22,8 @@ var ( func main() { // Load .env file - err := godotenv.Load() + _, b, _, _ := runtime.Caller(0) // @refactor + err := godotenv.Load(filepath.Join(filepath.Dir(b), ".env")) if err != nil { fmt.Println("Error loading .env file:", err) return