I'm really confused how to get the error type from a failed query line with the mySQL import. There is no real documentation on it, so it has me real confused.
Currently i have:
result, err := db.Exec("INSERT INTO users (username,password,email) VALUES (?,?,?)", username, hashedPassword, email)
if err != nil {
// handle different types of errors here
return
}
I could print err but its just a string, not liking the idea of peeking at strings to know what went wrong, is there no feedback to get an error code to perform a switch
on or something along those lines? How do you do it?