title: GET blob from sql database Golang
body: <pre><code> import (
         "database/sql"
         "encoding/json"
         "fmt"
  
         _ "github.com/go-sql-driver/mysql"
     ) 
     type User struct {
         Name string  `json:name`
         Picture []uint8 `json:picture`
      }
      func main(){
         //straight to the query
         rows, err := 'SELECT name, picture FROM ms_users' // picture is longblob type in database
         checkErr(err)
  
         var usr User
         for rows.Next(){
            err = rows.Scan(&amp;usr.Name, &amp;usr.Picture)
            checkErr(err)
         }
         jsn, err := json.Marshal(usr)
         fmt.Printf("%v, "string(jsn))
      }
  </code></pre>
  
  <p>With above code, I only get name value but the picture is empty.
  How do I store blob value from databse to struct ?
  Any answer will be appreciated! thank you!</p>