Skip to content

Instantly share code, notes, and snippets.

@wunki
Created April 21, 2015 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wunki/188deb60699e90918340 to your computer and use it in GitHub Desktop.
Save wunki/188deb60699e90918340 to your computer and use it in GitHub Desktop.
// FindOne returns a single thread in the API
func (a *AppContext) FindOne(c *echo.Context) error {
id := c.P(0)
thread, err := a.ThreadStorage.FindOne(id)
if err != nil {
return c.JSON(http.StatusNotFound, nil)
}
return c.JSON(http.StatusOK, thread)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment