fix(config): fix configuration management

This commit is contained in:
2025-10-13 16:47:09 +02:00
parent 3d85723de9
commit fac5eb8a66
7 changed files with 113 additions and 58 deletions

View File

@@ -16,8 +16,8 @@ type Service struct {
// NewService initializes and returns a new database service.
func NewService(cfg *config.DatabaseConfig) (*Service, error) {
connStr := fmt.Sprintf("user=%s password=%s dbname=%s host=%s port=%d sslmode=%s",
cfg.User, cfg.Password, cfg.Dbname,
cfg.Host, cfg.Port, cfg.Sslmode,
cfg.User, cfg.Password, cfg.DBName,
cfg.Host, cfg.Port, cfg.SSLMode,
)
db, err := sql.Open("postgres", connStr)