Registry / utility / b
library1.1.0gogounverified

Package b implements the B+tree flavor of a BTree, providing an ordered key-value store with interface{} keys and values.

go get modernc.org/b
INSTALL
IMPORT
SIG · B
B
b
utilitygov1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

b
modernc.org/b

Create and use a B+tree with integer keys

package main import ( "fmt" "modernc.org/b" ) func main() { tree := b.TreeNew(func(a, b interface{}) int { return a.(int) - b.(int) }) tree.Set(1, "one") v, ok := tree.Get(1) fmt.Println(v, ok) }
Debug
Known issues
gotchaTree methods that mutate (Clear, Delete, Put, Set) are not safe for concurrent use without external synchronization.
fix
Wrap mutation calls with sync.Mutex or sync.RWMutex.
affects: all
Upgrade
Version history
1.1.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
2
Resources
b — go get b · libregistry