title: JSON response in Golang’s GIN returning as scrambled data
body: <p>I have array of a struct being created from data I collected from the database.</p>
  
  <p>For simplicity, lets say this is the struct:</p>
  
  <pre><code>type Person struct {
  ID        int    `db:"id, json:"id"`
  }
  
  type PessoalController struct{}
  
  func (ctrl PessoalController) GetPessoal(c *gin.Context) { 
      q := "select id from rh"
  
      rows, err := db.GetDB().Query(q)
      if err != nil {
          log.Fatal(err)
      }
      defer rows.Close()
  
      var pessoas []Pessoal
  
      var id
      for rows.Next() {
          err := rows.Scan(&amp;id)
          if err != nil {
              log.Fatal(err)
      }
      pessoas = append(pessoas, Pessoal{ ID: id,})
  
      JsonPessoal, errr := json.Marshal(pessoas)
      if errr != nil {
          log.Fatal(err)
      }
      c.JSON(200, pessoas)
      if err != nil {
          return
      }
  
      return
  }
  </code></pre>
  
  <p>When I print it, I do get the JSON I expected. 
  But when I send the response, I get raw-looking data like “W3siWQiQjlyNDYslNpYx...”</p>
  
  <p>Have no idea how to proceed.</p>
  
  <p>Edit :  Minimal, Complete, and Verifiable example.</p>