DATA-DOG / go-sqlmock

Sql mock driver for golang to test database interactions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot test an error being return in LastResultId

tapocol opened this issue · comments

LastInsertId always passes back the int64 in the mocked result. Can't quite get to 100% code coverage without forcing a LastInsertId error.

func (r *result) LastInsertId() (int64, error) {
    return r.insertID, nil
}

https://github.com/DATA-DOG/go-sqlmock/blob/master/result.go#L25