go-sqlmock
go-sqlmock copied to clipboard
Arguments Error
hey All mock.ExpectExec("SELECT * FROM permission WHERE roleid = $1").WithArgs(2) this is my mock queey i just compare that one with the original query which one is db.Get(&programinfo, "SELECT * FROM permission WHERE roleid = $1", roleid) but i found that error call to Query 'SELECT * FROM permission WHERE roleid = $1' with args [{Name: Ordinal:1 Value:2}], was not expected, next expectation is: ExpectedExec => expecting Exec or ExecContext which:
- matches sql: 'SELECT * FROM permission WHERE roleid = $1'
- is with arguments: there is a remaining expectation which was not matched: ExpectedExec => expecting Exec or ExecContext which: - matches sql: 'SELECT * FROM permission WHERE roleid = $1' - is with arguments: 0 - 2 Can SomeOne please help me how i fixed this issue Thanks
Please post some example code working on the Go Playground. Here is a template.
Same issue, have you fixed it?
Facing same issue. Any updates?