Cleaning up our code

This commit is contained in:
2024-07-07 22:37:48 +02:00
parent 44385fbbce
commit 18c82ba19f
6 changed files with 22 additions and 19 deletions

View File

@ -48,6 +48,9 @@ func main() {
func run() (*driver.DB, error) {
// what am I going to put in the session
gob.Register(models.Reservation{})
gob.Register(models.User{})
gob.Register(models.Room{})
gob.Register(models.Restriction{})
// change this to true when in production
app.InProduction = false
@ -87,6 +90,6 @@ func run() (*driver.DB, error) {
handlers.NewHandlers(repo)
helpers.NewHelpers(&app)
render.NewTemplates(&app)
render.NewRenderer(&app)
return db, nil
}

View File

@ -3,7 +3,7 @@ package main
import "testing"
func TestRun(t *testing.T) {
err := run()
_, err := run()
if err != nil {
t.Error("failed run()")
}