Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments Error #264

Open
afzalabbasi opened this issue Jun 23, 2021 · 3 comments
Open

Arguments Error #264

afzalabbasi opened this issue Jun 23, 2021 · 3 comments

Comments

@afzalabbasi
Copy link

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
@dolmen
Copy link
Contributor

dolmen commented Apr 22, 2022

Please post some example code working on the Go Playground. Here is a template.

@ShuaoZhang
Copy link

Same issue, have you fixed it?

@bekha-io
Copy link

bekha-io commented Dec 7, 2023

Facing same issue. Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants