INNER CODE UNIT · Go
xorNames
GGP1/kure · migration/v1/main.go:48
func xorNames(db *bolt.DB, r io.Reader) error {
if !terminal.Confirm(r, confMessage) {
return nil
}
tx, err := db.Begin(true)
if err != nil {
return errors.Wrap(err, "starting transaction")
}
defer tx.Rollback()
buckets := bucket.GetNames()
for _, bucket := range buckets {
b := tx.Bucket(bucket)
cursor := b.Cursor()
mp := make(map[string]record, b.Stats().KeyN)
// The bucket mustn't be modified inside the loop; this will result in undefined behavior