These are chat archives for gin-gonic/gin

Jan 2016
Alix Axel
Jan 21 2016 17:58
Can anyone tell me if there's a way to "short-circuit" responses, i.e.: whenever an error occurs without having to explicitly do return afterwards?
Like, this wouldn't work:
router.GET("/ping", func(c *gin.Context) {
    stuff := new(Stuff)

    if err := stuff.Save(); err != nil {
        c.JSON(http.StatusInternalServerError, err)

    c.JSON(http.StatusCreated, stuff)
Craig Peterson
Jan 21 2016 19:50
Nope, you gotta add the return