storj/satellite/metainfo/metabase/util.go
Egon Elbre 184e1ffa9d satellite/metainfo/metabase: commit object without proofs
Change-Id: I788111b9e5bdc961be9e731f8203e52ca9da9dca
2020-11-09 15:18:07 +00:00

21 lines
423 B
Go

// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
package metabase
import (
"github.com/zeebo/errs"
"storj.io/storj/private/tagsql"
)
func withRows(rows tagsql.Rows, err error) func(func(tagsql.Rows) error) error {
return func(callback func(tagsql.Rows) error) error {
if err != nil {
return err
}
err := callback(rows)
return errs.Combine(rows.Err(), rows.Close(), err)
}
}