diff --git a/examples/htmx-fiber-todo/main.go b/examples/htmx-fiber-todo/main.go index 9320eaa..6759b3a 100644 --- a/examples/htmx-fiber-todo/main.go +++ b/examples/htmx-fiber-todo/main.go @@ -8,6 +8,7 @@ import ( "github.com/chasefleming/elem-go/attrs" "github.com/chasefleming/elem-go/styles" "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/utils" ) // Todo model @@ -54,7 +55,7 @@ func toggleTodoRoute(c *fiber.Ctx) error { } func addTodoRoute(c *fiber.Ctx) error { - newTitle := c.FormValue("newTodo") + newTitle := utils.CopyString(c.FormValue("newTodo")) if newTitle != "" { todos = append(todos, Todo{ID: len(todos) + 1, Title: newTitle, Done: false}) }