I want to test some SQL like:
select name from user where uid = ?
This is ok, I can mock it like this way:
rows := sqlmock.NewRows([]string{“name"}).AddRow(“info")
did = "1234"
mock.ExpectPrepare(“select name from user where uid = ?").ExpectQuery().
WithArgs(uid).
WillReturnRows(rows)
But I want to mock the testing in which the user table does not have this uid — the select will return a Empty set
mysql> select * from user where uid = “887";
Empty set (0.00 sec)
mysql>
How can I mock an empty table?