refactor: migrate env-var reads to config package

This commit is contained in:
2026-05-26 15:38:14 +02:00
parent 26ff84d70f
commit 1e9874a482
8 changed files with 34 additions and 35 deletions

View File

@@ -11,12 +11,18 @@ import (
"github.com/google/uuid"
"golang.org/x/crypto/bcrypt"
"mal/internal/config"
"mal/internal/database"
"mal/internal/db"
)
func main() {
dbConn, err := db.Open(db.GetDBFile())
cfg, err := config.Load()
if err != nil {
log.Fatalf("load config: %v", err)
}
dbConn, err := db.Open(cfg.DatabaseFile)
if err != nil {
log.Fatalf("failed to open db: %v", err)
}