With the following codes
var record []bigquery.Value
err := it.Next(&record)
if err == iterator.Done {
break
}
if err != nil {
fmt.Println("Failed to parse bigquery value")
}
fmt.Println(record)
The results are
[74BkBzTiR 1 2018-09-09]
[74BkBzTiR 2 2018-09-09]
[74BkBzTiR 3 2018-09-09]
However, when I use the following struct to map those row data
var record struct {
Uid string
Level int
UtcDate civil.Date
}
err := it.Next(&record)
if err == iterator.Done {
break
}
if err != nil {
fmt.Println("Failed to parse bigquery value")
}
fmt.Println(record)
Give results
{74BkBzTiR 1 0000-00-00}
{74BkBzTiR 2 0000-00-00}
{74BkBzTiR 3 0000-00-00}
The date 2018-09-09 map to 0000-00-00.
Is there something wrong with my codes or anything I am missing?