0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Golang - MySQL Scan Error

Posted at

Problem

sql: Scan error on column index 5, name \"time\": unsupported Scan, storing driver.Value type []uint8 into type *time.Time]"}

Solution

You need added string "parseTime=true" in mysql connection setting.

db, err := sql.Open("mysql", "root:@/?parseTime=true")

https://stackoverflow.com/questions/29341590/how-to-parse-time-from-database/29343013#29343013
https://stackoverflow.com/questions/45040319/unsupported-scan-storing-driver-value-type-uint8-into-type-time-time

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?