Skip to content

Cannot test an error being return in LastResultId #5

Closed
@tapocol

Description

@tapocol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions