Remove env path hardcode

This commit is contained in:
Illya Marchenko 2024-10-02 23:04:32 +03:00
parent 66fdae2832
commit f1e987f4b8
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F

@ -2,20 +2,15 @@ package main
import (
"fmt"
"os"
"path/filepath"
"runtime"
"gitea.stuzer.link/stuzer05/docker-registry-manager/cmd"
"gitea.stuzer.link/stuzer05/docker-registry-manager/internal/app"
"github.com/joho/godotenv"
"os"
)
func main() {
// Load .env file
_, b, _, _ := runtime.Caller(0)
err := godotenv.Load(filepath.Join(filepath.Dir(b), ".env"))
err := godotenv.Load()
if err != nil {
fmt.Println("Error loading .env file:", err)
return