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

add ExpectDo methods #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ideasculptor
Copy link

Added example implementations for handling Do() with various return types. Needs to be fleshed out with all of the various potential return types and tests, but demonstrates the concept. I may eventually get around to implementing the feature in its entirety, but probably not anytime soon, unfortunately, so this PR exists largely for documentary purposes in the associated issue: #25

@ilovejs
Copy link

ilovejs commented Feb 28, 2023

Any progress on That?? @ideasculptor @ryantate13

@ideasculptor
Copy link
Author

I'll update the PR so that it is up to date with go-redis:master but I doubt either of us is going to find ourselves with the time to do the full implementation that would be required to get someone to merge this any time soon. This fork serves our needs sufficiently as it is.

Check back in a few hours and I should have the PR updated.

@ideasculptor
Copy link
Author

Check back in a few hours and I should have the PR updated.

done

@monkey92t
Copy link
Member

client.Do is a special API, its return value is not a fixed data type, if you want to set the return value of int64, please refer to the example:

         // or []interface{}{int64(100), int64(200)}
	mock.ExpectDo("hkeys", "hkey").SetVal([]interface{}{"100", "200"}) 
	v, err := client.Do(ctx, "hkeys", "hkey").Int64Slice()
	t.Log(v, err)

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

Successfully merging this pull request may close these issues.

3 participants