boilerplate
boilerplate copied to clipboard
does builderplate code handle zero allocations correctly?
Hi there, I just got started with Fiber today. My own experiments worked fine, but trying out this boilerplate app looked wrong. When entering a couple of user names and then doing a reload the list seem to be the same strings with varying length. That looks to me that the buffer is not handled correctly.
changing the following in database.go
seems to fix it
func UserCreate(c *fiber.Ctx) error {
user := &models.User{
Name: utils.ImmutableString(c.FormValue("user")),
}
//...
I just wanted to confirm that this is correct and the right place - and I'm not missing something blindingly obvious as a beginner
I had the same problem, your solution worked for me also. BTW, ImmutableString
is deprecated now and should be changed to CopyString
.