Creating a database table for items for sale
This commit is contained in:
		@ -6,6 +6,7 @@ import (
 | 
			
		||||
	"html/template"
 | 
			
		||||
	"log"
 | 
			
		||||
	"myapp/internal/driver"
 | 
			
		||||
	"myapp/internal/models"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"os"
 | 
			
		||||
	"time"
 | 
			
		||||
@ -35,6 +36,7 @@ type application struct {
 | 
			
		||||
	errorLog      *log.Logger
 | 
			
		||||
	templateCache map[string]*template.Template
 | 
			
		||||
	version       string
 | 
			
		||||
	DB            models.DBModel
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (app *application) serve() error {
 | 
			
		||||
@ -95,6 +97,7 @@ func main() {
 | 
			
		||||
		errorLog:      errorLog,
 | 
			
		||||
		templateCache: tc,
 | 
			
		||||
		version:       version,
 | 
			
		||||
		DB:            models.DBModel{DB: conn},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	app.infoLog.Println("Connected to MariaDB")
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user