mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-05-31 11:42:30 +00:00
Merge pull request #427 from ahrtr/update_check_20230315
bbolt: remove `CheckWithOptions` and add variadic parameter options to method `Check`
This commit is contained in:
commit
5c7326c1dd
@ -206,7 +206,7 @@ func (cmd *checkCommand) Run(args ...string) error {
|
|||||||
// Perform consistency check.
|
// Perform consistency check.
|
||||||
return db.View(func(tx *bolt.Tx) error {
|
return db.View(func(tx *bolt.Tx) error {
|
||||||
var count int
|
var count int
|
||||||
for err := range tx.CheckWithOptions(bolt.WithKVStringer(CmdKvStringer())) {
|
for err := range tx.Check(bolt.WithKVStringer(CmdKvStringer())) {
|
||||||
fmt.Fprintln(cmd.Stdout, err)
|
fmt.Fprintln(cmd.Stdout, err)
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
|
@ -15,13 +15,10 @@ import (
|
|||||||
// because of caching. This overhead can be removed if running on a read-only
|
// 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
|
// transaction, however, it is not safe to execute other writer transactions at
|
||||||
// the same time.
|
// the same time.
|
||||||
func (tx *Tx) Check() <-chan error {
|
//
|
||||||
return tx.CheckWithOptions()
|
// It also allows users to provide a customized `KVStringer` implementation,
|
||||||
}
|
|
||||||
|
|
||||||
// CheckWithOptions allows users to provide a customized `KVStringer` implementation,
|
|
||||||
// so that bolt can generate human-readable diagnostic messages.
|
// 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{
|
chkConfig := checkConfig{
|
||||||
kvStringer: HexKVStringer(),
|
kvStringer: HexKVStringer(),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user