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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add Cmder annotation #2816

Merged
merged 4 commits into from
Dec 17, 2023

Conversation

rfyiamcool
Copy link
Contributor

@rfyiamcool rfyiamcool commented Nov 29, 2023

summary

Every time I call this methods, I need to test the output, I have added some samples of the output here. Next time I look at the code comments, I'll know how to use these methods. 馃榿

e.g. by printing the data, I knew the difference of the methods in Cmder.

...

func (redisHook) ProcessHook(hook redis.ProcessHook) redis.ProcessHook {
	return func(ctx context.Context, cmd redis.Cmder) error {
		fmt.Printf("starting processing: <%s>\n", cmd)
		err := hook(ctx, cmd)
		fmt.Printf("finished processing: <%s>\n", cmd)

		fmt.Printf("--- %+v \n", cmd.FullName())
		fmt.Printf("--- %+v \n", cmd.Args())
		fmt.Printf("--- %+v \n", cmd.Name())
		fmt.Printf("--- %+v \n", cmd.String())
		fmt.Printf("--- %+v \n", cmd.Err())

		return err
	}
}

...

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
@ofekshenawa ofekshenawa merged commit 8c69548 into redis:master Dec 17, 2023
9 checks passed
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.

None yet

2 participants