I was trying to follow the example in the answer given here: Golang: How to check for empty array (array of struct)
on how to check if a database return is empty
So I have this:
err = db.QueryRow("SELECT FROM accounts WHERE steamid=?", steamid)
switch {
case err == sql.ErrNoRows:
case err != nil:
default:
//do stuff
}
But I get the error:
cannot use db.QueryRow("SELECT FROM accounts WHERE steamid=?", steamid) (type *sql.Row) as type error in assignment:
*sql.Row does not implement error (missing Error method)
Not sure why it worked in his example but not when I try to implement it. Thanks.