title: Golang/gin parse JSON from gin.Context
body: <p>I learned from the gin doc that you can bind json to a struct like </p>
  
  <pre><code>type Login struct {
      User     string `form:"user" json:"user" binding:"required"`
      Password string `form:"password" json:"password" binding:"required"`
  }
  
  func main() {
      router := gin.Default()
  
      // Example for binding JSON ({"user": "manu", "password": "123"})
      router.POST("/loginJSON", func(c *gin.Context) {
          var json Login
          if c.BindJSON(&amp;json) == nil {
              if json.User == "manu" &amp;&amp; json.Password == "123" {
                  c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
              } else {
                  c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"})
              }
          }
      })
  }
  </code></pre>
  
  <p>You always have to build a struct to bind JSON.</p>
  
  <p>But if there is a very complex JSON data, I only what to get part of it, to create a complex struct is a big burden. Can avoid id and parse it directly?</p>