Skip to content

Instantly share code, notes, and snippets.

@Depado
Created March 27, 2018 14:06
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 Depado/4af17877db370c99db90106d8f9612aa to your computer and use it in GitHub Desktop.
Save Depado/4af17877db370c99db90106d8f9612aa to your computer and use it in GitHub Desktop.
type searchParams struct {
Alcohol string `json:"alcohol"`
DrinkType string `json:"drink-type"`
Name string `json:"name"`
}
func search(c *gin.Context, dfr *df.Request) {
var err error
var p searchParams
if err = dfr.GetParams(&p); err != nil {
logrus.WithError(err).Error("Couldn't get parameters")
c.AbortWithStatus(http.StatusBadRequest)
return
}
spew.Dump(p)
c.JSON(http.StatusOK, gin.H{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment