Skip to content
dbrain edited this page Jun 6, 2012 · 1 revision

Here's a list of possible gotchas while coding against soggy, in @dbrain braindump format.

Zero value return from a route

If a route returns a zero value (or nil where applicable) it will not call a render function (unless it has an error, then it will call the error handler). This is to allow routes with a return to call Next without writing to the res again.

  • func() string: If you return "" nothing will be rendered (vs. usual html)
  • func() interface{}: If you return nil nothing will be rendered (vs. usual JSON)
  • func() (string, interface{}): If you return "" for string (i.e. template name) nothing will be rendered.
Clone this wiki locally