Skip to content

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
	}
}

...

@rfyiamcool rfyiamcool force-pushed the fix/add_cmder_annotation branch from 61e92aa to 0c8b696 Compare November 29, 2023 15:42
@ofekshenawa ofekshenawa merged commit 8c69548 into redis:master Dec 17, 2023
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.

2 participants