thomasvvugt / fiber-boilerplate

A boilerplate for the Fiber web framework
MIT License
267 stars 45 forks source link

Where return after c.Send ? #7

Closed arkady-bagdasarov closed 3 years ago

arkady-bagdasarov commented 3 years ago

I read about how to structure fiber project and saw this https://github.com/thomasvvugt/fiber-boilerplate/blob/155cd94b6dd241763db2bd7e9d27173edf495202/app/controllers/api/UserController.go#L15

Why after this string you didn't do return? Because if you didn't do return from func your code will continue executing next, right?

arkady-bagdasarov commented 3 years ago

And also c.Send() method gets only one parameter. Please, correct me if i wrong. https://github.com/gofiber/fiber/blob/master/ctx.go#L893

thomasvvugt commented 3 years ago

Hi @arkady-bagdasarov, this behavior was indeed updated in Fiber v2. I am planning on updating my repository soon™.

jeffphp commented 3 years ago

Hi @arkady-bagdasarov, this behavior was indeed updated in Fiber v2. I am planning on updating my repository soon™.

In case it helps, I did a fork to V2 here : https://github.com/JeffPHP/fiber-gofiber-v2-boilerplate

thomasvvugt commented 3 years ago

See #9