Skip to content

Commit ea01d38

Browse files
authored
Rename option builder from WithInmemory to WithInMemory. (#1169)
The name of the option builder func should be spelled the same as the option name itself. The godoc already has the func documented as "WithInMemory".
1 parent df99253 commit ea01d38

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ Please note that Badger obtains a lock on the directories so multiple processes
125125
cannot open the same database at the same time.
126126

127127
#### In-Memory Mode/Diskless Mode
128-
By default, badger ensures all the data is presisted to the disk. It also supports a pure
129-
`In-Memory` mode. When Badger is running in `in-memory` mode, all the data is stored in the memory.
130-
The read/writes are much faster in `in-memory` mode but all the data stored in badger will be lost
131-
in case of a crash or close. To open badger in `in-memory` mode, set the `InMemory` option.
128+
By default, Badger ensures all the data is persisted to the disk. It also supports a pure
129+
in-memory mode. When Badger is running in in-memory mode, all the data is stored in the memory.
130+
Reads and writes are much faster in in-memory mode, but all the data stored in Badger will be lost
131+
in case of a crash or close. To open badger in in-memory mode, set the `InMemory` option.
132132

133133
```
134-
opt := badger.DefaultOptions("").WithInmemory(true)
134+
opt := badger.DefaultOptions("").WithInMemory(true)
135135
```
136136

137137
### Transactions

db_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func TestGet(t *testing.T) {
283283
})
284284
})
285285
t.Run("InMemory mode", func(t *testing.T) {
286-
opts := DefaultOptions("").WithInmemory(true)
286+
opts := DefaultOptions("").WithInMemory(true)
287287
db, err := Open(opts)
288288
require.NoError(t, err)
289289
test(t, db)
@@ -543,7 +543,7 @@ func TestExistsMore(t *testing.T) {
543543
})
544544
})
545545
t.Run("InMemory mode", func(t *testing.T) {
546-
opt := DefaultOptions("").WithInmemory(true)
546+
opt := DefaultOptions("").WithInMemory(true)
547547
db, err := Open(opt)
548548
require.NoError(t, err)
549549
test(t, db)
@@ -617,7 +617,7 @@ func TestIterate2Basic(t *testing.T) {
617617
})
618618
})
619619
t.Run("InMemory mode", func(t *testing.T) {
620-
opt := DefaultOptions("").WithInmemory(true)
620+
opt := DefaultOptions("").WithInMemory(true)
621621
db, err := Open(opt)
622622
require.NoError(t, err)
623623
test(t, db)
@@ -1662,7 +1662,7 @@ func TestGoroutineLeak(t *testing.T) {
16621662
test(t, nil)
16631663
})
16641664
t.Run("InMemory mode", func(t *testing.T) {
1665-
opt := DefaultOptions("").WithInmemory(true)
1665+
opt := DefaultOptions("").WithInMemory(true)
16661666
test(t, &opt)
16671667
})
16681668
}
@@ -2034,7 +2034,7 @@ func removeDir(dir string) {
20342034
}
20352035

20362036
func TestWriteInemory(t *testing.T) {
2037-
opt := DefaultOptions("").WithInmemory(true)
2037+
opt := DefaultOptions("").WithInMemory(true)
20382038
db, err := Open(opt)
20392039
require.NoError(t, err)
20402040
defer func() {

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ func (opt Options) WithMaxCacheSize(size int64) Options {
549549
//
550550
// When badger is running in InMemory mode, everything is stored in memory. No value/sst files are
551551
// created. In case of a crash all data will be lost.
552-
func (opt Options) WithInmemory(b bool) Options {
552+
func (opt Options) WithInMemory(b bool) Options {
553553
opt.InMemory = b
554554
return opt
555555
}

0 commit comments

Comments
 (0)