Cleaning up our code
This commit is contained in:
		@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ package main
 | 
			
		||||
import "testing"
 | 
			
		||||
 | 
			
		||||
func TestRun(t *testing.T) {
 | 
			
		||||
	err := run()
 | 
			
		||||
	_, err := run()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Error("failed run()")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user