func closeIterator(it sorted.Iterator, perr *error) { err := it.Close() if err != nil && *perr == nil { *perr = err } }