Some work around bindings. it may do not compile

This commit is contained in:
Manu Mtz-Almeida
2014-07-03 19:19:06 +02:00
parent b8053b284d
commit 1aa3216303
3 changed files with 72 additions and 9 deletions

View File

@ -44,7 +44,8 @@ func main() {
var json struct {
Value string `json:"value" binding:"required"`
}
if c.EnsureBody(&json) {
if c.Bind(&json) {
DB[user] = json.Value
c.JSON(200, gin.H{"status": "ok"})
}