Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Commit 1e271f5

Browse files
committed
Update README.md
Add warning to README.md that keys and values in `ForEach()` are invalid outside of transaction.
1 parent 9dffd9d commit 1e271f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ db.View(func(tx *bolt.Tx) error {
448448
})
449449
```
450450

451+
Please note that keys and values in `ForEach()` are only valid while
452+
the transaction is open. If you need to use a key or value outside of
453+
the transaction, you must use `copy()` to copy it to another byte
454+
slice.
451455

452456
### Nested buckets
453457

0 commit comments

Comments
 (0)