go-sqlmock
go-sqlmock copied to clipboard
Unable to mock the rows.Columns() error
Is there a way to mock the rows.Columns() error? I've tried using RowsWillBeClosed but it seems that does not immediately close the mock rows. Is it more like a defer?
Hi, at the moment I do not think this is mockable, probably worth looking how it could be added.
Regarding RowsWillBeClosed, it just adds an expectation that the mocked rows have to be closed during the test unit. As far as I understand rows.Columns may return error in cases when connection is lost or rows are closed before calling it. but will need to investigate this
Thank you for your response. I had a use case where I wanted a call to rows.Columns() to give me an error for testing. Thanks for keeping it in mind as a possible enhancement. Feel free to close this issue as needed.
will be added to #187 at some point