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

Revert the signature of tx.Check and add tx.CheckWithStringer #395

Merged
merged 1 commit into from
Jan 29, 2023
Merged

Revert the signature of tx.Check and add tx.CheckWithStringer #395

merged 1 commit into from
Jan 29, 2023

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 28, 2023

See #225 (comment)

Signed-off-by: Benjamin Wang wachao@vmware.com

@ahrtr ahrtr added this to the 1.3.7 milestone Jan 28, 2023
@ahrtr ahrtr requested a review from ptabor January 29, 2023 00:43
tx_check.go Outdated

// CheckWithStringer allows users to provide a customized `KVStringer` implementation,
// so that bolt can generate human-readable diagnostic messages.
func (tx *Tx) CheckWithStringer(kvStringer KVStringer) <-chan error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. It's +- what I wanted to do:

How about more generic:

type CheckOptions struct{
   KeyValueStringer KVStringer
} 

CheckWithOptions(options CheckOptions) {...}

This will enable API compatibility going forward without the need to introduce additional methods.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's more flexible. The only minor concern is that it might be a little over engineering for now.

Updated & thx.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why we don't update the existing method (*Tx) Check() ? Why do we need to add a new one CheckWithOptions?

func (tx *Tx) Check(options ...CheckOption) <-chan error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this #427?

Signed-off-by: Benjamin Wang <wachao@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants