aboutsummaryrefslogtreecommitdiff
path: root/src/dedo.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-02-06 17:12:36 -0300
committerEuAndreh <eu@euandre.org>2025-02-06 17:12:36 -0300
commitaefcf17734a4b2ea25c9191ec80465c8307209b1 (patch)
tree5e661798e8c34ce499d62517c30893ed552af72c /src/dedo.go
parenttests/dedo.go: Add tests for usage(), getGetopt() and setGetopt() (diff)
downloaddedo-aefcf17734a4b2ea25c9191ec80465c8307209b1.tar.gz
dedo-aefcf17734a4b2ea25c9191ec80465c8307209b1.tar.xz
src/dedo.go: Remove StrictMode field from DB type
Diffstat (limited to '')
-rw-r--r--src/dedo.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/dedo.go b/src/dedo.go
index 8ebc4c4..84c4cea 100644
--- a/src/dedo.go
+++ b/src/dedo.go
@@ -49,7 +49,6 @@ import (
"log"
"os"
"sort"
- "strings"
"sync"
"syscall"
"time"
@@ -110,12 +109,6 @@ type elemRef struct {
/// DB. All the functions on DB will return a ErrDatabaseNotOpen if accessed
/// before Open() is called.
type DB struct {
- /// When enabled, the database will perform a Check() after every
- /// commit. A panic is issued if the database is in an inconsistent
- /// state. This flag has a large performance impact so it should only
- /// be used for debugging purposes.
- StrictMode bool
-
/// MaxBatchSize is the maximum size of a batch. Default value is
/// copied from DefaultMaxBatchSize in Open.
///
@@ -3454,23 +3447,6 @@ func (tx *Tx) commit() error {
return err
}
- // If strict mode is enabled then perform a consistency check.
- // Only the first consistency error is reported in the panic.
- if tx.db.StrictMode {
- ch := tx.Check()
- errs := []string{}
- for {
- err, ok := <-ch
- if !ok {
- break
- }
- errs = append(errs, err.Error())
- }
- if len(errs) > 0 {
- panic("check fail: " + strings.Join(errs, "\n"))
- }
- }
-
// Write meta to disk.
err = tx.writeMeta()
if err != nil {