mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-05-28 10:12:05 +00:00
Update README.md
Add warning to README.md that keys and values in `ForEach()` are invalid outside of transaction.
This commit is contained in:
parent
9dffd9de3b
commit
1e271f5035
@ -448,6 +448,10 @@ db.View(func(tx *bolt.Tx) error {
|
||||
})
|
||||
```
|
||||
|
||||
Please note that keys and values in `ForEach()` are only valid while
|
||||
the transaction is open. If you need to use a key or value outside of
|
||||
the transaction, you must use `copy()` to copy it to another byte
|
||||
slice.
|
||||
|
||||
### Nested buckets
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user