Hi folks, I need some help. I'm trying to test my repository using go-sqlmock, but I'm getting some errors. I don't think it is a bug, so... let me open it as a question, so we can figure out if it needs to be converted to a bug.
2022/07/16 18:23:31 an error 'error preparing statement list course: Prepare: could not match actual sql: "SELECT * FROM courses" with expected regexp "SELECT \* FROM courses WHERE uuid = \$1"' was not expected when creating the repository
The craziest part is that it fails in some random query preparation, it is not always the same, and of course, it means that sometimes it passes without any issues. What am I doing wrong? What am I missing?
Question
Hi folks, I need some help. I'm trying to test my repository using go-sqlmock, but I'm getting some errors. I don't think it is a bug, so... let me open it as a question, so we can figure out if it needs to be converted to a bug.
So, the code of the tests is here And the error that I'm getting seems to be at the Repository constructor
The craziest part is that it fails in some random query preparation, it is not always the same, and of course, it means that sometimes it passes without any issues. What am I doing wrong? What am I missing?