In a Go app, using sqlx
package and mysql database, I want to update table user
and increment its posts
field by 1:
err = shared.Dbmap.Exec("UPDATE user SET posts=posts+1 WHERE id=?", userId)
if err != nil {
log.Println(err)
return
}
However at compile time I get:
multiple-value shared.Dbmap.DB.Exec() in single-value context
I looked at the docs and could not see relevant examples.
How can I fix it?