title: unsupported Scan, storing driver.Value type []uint8 into type *time.Time
body: <p>I have difficulty querieing for users, which is defined as:</p>
  
  <pre><code>type User struct {
      ID           int       `db:"id" json:"id"`            
      UserName     string    `db:"username" json:"username"` 
      Email        string    `db:"email" json:"email"`
      CreatedAt    time.Time `db:"created_at" json:"created_at"`
      StatusID     uint8     `db:"status_id" json:"status_id"`
      Deleted      uint8     `db:"deleted" json:"deleted"`
  ... 
  }
  </code></pre>
  
  <p>And the table in MariaDB is defined as:</p>
  
  <pre><code>+--------------+------------------+------+-----+-------------------+----------------+
  | Field        | Type             | Null | Key | Default           | Extra          |
  +--------------+------------------+------+-----+-------------------+----------------+
  | id           | int(10) unsigned | NO   | PRI | NULL              | auto_increment |
  | username     | varchar(50)      | NO   |     | NA                |                |
  | email        | varchar(255)     | NO   |     | NULL              |                |
  | created_at   | datetime         | NO   |     | CURRENT_TIMESTAMP |                |
  | status_id    | tinyint(1)       | NO   |     | 0                 |                |
  | deleted      | tinyint(1)       | NO   |     | 0                 |                |
  ...              |
  </code></pre>
  
  <p>However when I query it like:</p>
  
  <pre><code>func GetUsers(c *gin.Context) {
      var users []model.User
      err := shared.Dbmap.Select(&amp;users, "SELECT * FROM user")
  
      if err == nil {
          c.JSON(200, users)
      } else {
          fmt.Println("%v \n", err)
          c.JSON(http.StatusInternalServerError, gin.H{"error": "no user(s) in the table or problem in the query"})
      }
  
      // curl -i http://127.0.0.1:8080/api/v1/users
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>sql: Scan error on column index 3: unsupported Scan, storing driver.Value type []uint8 into type *time.Time
  </code></pre>
  
  <p>while there are some rows in the table. </p>
  
  <p>I have also tried <code>created_at</code> as  <code>timestamp</code> but still get the same error.</p>
  
  <p>So I'm left clueless as what wrong here? How can I fix it? </p>
  
  <p><strong>P.S.</strong> Though my question turned out to have the same answer as <a href="https://stackoverflow.com/questions/29341590/go-parse-time-from-database">this</a> but here the context is different (<code>sqlx</code> instead of <code>go-sql-driver/mysql</code>). Also since here the error is the subject it probably more searchable for people who google the same error. So perhaps this worth keeping as a separate question. </p>