When attempting to use the examples from github.com/mattn/go-sqlite3's repository, I get the following error when trying to compile the code with Go 1.5.1 darwin/amd64:
non-bool rows.Next() (type error) used as for condition
The code I'm using is:
conn, err := sqlite3.Open("./example.db")
if err != nil {
log.Panic(err)
}
defer conn.Close()
rows, err := conn.Query("SELECT * FROM scans ORDER BY id DESC;")
if err != nil {
log.Panic(err)
}
for rows.Next() {
var id int
var method string
var uuid string
var scan int
rows.Scan(&id, &method, &uuid, &scan)
log.Print(id, method, uuid, scan)
}
Is there something which I am missing here? This is based on the example found here: https://github.com/mattn/go-sqlite3/blob/master/_example/simple/simple.go#L81-L91