Skip to content

Commit

Permalink
Merge pull request #427 from ahrtr/update_check_20230315
Browse files Browse the repository at this point in the history
bbolt: remove `CheckWithOptions` and add variadic parameter options to method `Check`
  • Loading branch information
ahrtr authored Mar 15, 2023
2 parents 87a1781 + f7d0ed5 commit 5c7326c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/bbolt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (cmd *checkCommand) Run(args ...string) error {
// Perform consistency check.
return db.View(func(tx *bolt.Tx) error {
var count int
for err := range tx.CheckWithOptions(bolt.WithKVStringer(CmdKvStringer())) {
for err := range tx.Check(bolt.WithKVStringer(CmdKvStringer())) {
fmt.Fprintln(cmd.Stdout, err)
count++
}
Expand Down
9 changes: 3 additions & 6 deletions tx_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ import (
// because of caching. This overhead can be removed if running on a read-only
// transaction, however, it is not safe to execute other writer transactions at
// the same time.
func (tx *Tx) Check() <-chan error {
return tx.CheckWithOptions()
}

// CheckWithOptions allows users to provide a customized `KVStringer` implementation,
//
// It also allows users to provide a customized `KVStringer` implementation,
// so that bolt can generate human-readable diagnostic messages.
func (tx *Tx) CheckWithOptions(options ...CheckOption) <-chan error {
func (tx *Tx) Check(options ...CheckOption) <-chan error {
chkConfig := checkConfig{
kvStringer: HexKVStringer(),
}
Expand Down

0 comments on commit 5c7326c

Please sign in to comment.