Remove load .env from bin path

This commit is contained in:
Illya Marchenko 2024-10-08 16:58:13 +03:00
parent 540eef981f
commit 917d6d9103
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F

10
main.go

@ -12,20 +12,12 @@ import (
"log" "log"
"net/http" "net/http"
"os" "os"
"path/filepath"
"stuzer.link/monobank-firefly3-bot/app" "stuzer.link/monobank-firefly3-bot/app"
) )
func main() { func main() {
// Get executable directory
exePath, err := os.Executable()
if err != nil {
log.Fatal("Error getting executable path:", err)
}
exeDir := filepath.Dir(exePath)
// load .env // load .env
godotenv.Load(filepath.Join(exeDir, ".env")) godotenv.Load(".env")
// init app // init app
app.Init() app.Init()