package main import ( "net/http" "github.com/gin-gonic/gin" ) func showIndexPage(c *gin.Context) { reminders, _ := getAllReminds() // Вызовем метод HTML из Контекста Gin для обработки шаблона c.HTML( // Зададим HTTP статус 200 (OK) http.StatusOK, // Используем шаблон index.html "index.html", // Передадим данные в шаблон gin.H{ "title": "Home Page", "payload": reminders, }, ) } func showOneRemind(c *gin.Context) { var remind Remind if err := DB.Where("id = ?", c.Param("id")).First(&remind).Error; err != nil { c.HTML(http.StatusBadRequest, "404.html", gin.H{"title": "Error", "error": "Record not found!"}) return } c.HTML( // Зададим HTTP статус 200 (OK) http.StatusOK, // Используем шаблон index.html "remind.view.html", // Передадим данные в шаблон gin.H{ "title": "View remind", "payload": remind, }, ) } func createOneRemind(c *gin.Context) {}