pass gosimple

pull/18/head
Anthony Romano 2017-08-10 21:39:16 -07:00
parent 89b9a2c19e
commit e5514a24a6
2 changed files with 4 additions and 15 deletions

View File

@ -188,17 +188,9 @@ func (cmd *CheckCommand) Run(args ...string) error {
// Perform consistency check.
return db.View(func(tx *bolt.Tx) error {
var count int
ch := tx.Check()
loop:
for {
select {
case err, ok := <-ch:
if !ok {
break loop
}
fmt.Fprintln(cmd.Stdout, err)
count++
}
for err := range tx.Check() {
fmt.Fprintln(cmd.Stdout, err)
count++
}
// Print summary of errors.

5
tx.go
View File

@ -126,10 +126,7 @@ func (tx *Tx) DeleteBucket(name []byte) error {
// the error is returned to the caller.
func (tx *Tx) ForEach(fn func(name []byte, b *Bucket) error) error {
return tx.root.ForEach(func(k, v []byte) error {
if err := fn(k, tx.root.Bucket(k)); err != nil {
return err
}
return nil
return fn(k, tx.root.Bucket(k))
})
}