aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2015-03-24 11:06:28 -0600
committerBen Johnson <benbjohnson@yahoo.com>2015-03-24 11:06:28 -0600
commit112f14363169288b9e111025703b7459b450469e (patch)
tree3fbae5dd45ba44c7479ff9c4609f0362b946c224 /bucket.go
parentMerge pull request #330 from benbjohnson/tx-writer-to (diff)
downloaddedo-112f14363169288b9e111025703b7459b450469e.tar.gz
dedo-112f14363169288b9e111025703b7459b450469e.tar.xz
Document key/value safety.
This commit adds safety documentation to the data accessor functions in Bolt as well as the README. This was documented once in the package level godoc but it's important enough that it should be more clear.
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/bucket.go b/bucket.go
index 470689b..6766992 100644
--- a/bucket.go
+++ b/bucket.go
@@ -252,6 +252,7 @@ func (b *Bucket) DeleteBucket(key []byte) error {
// Get retrieves the value for a key in the bucket.
// Returns a nil value if the key does not exist or if the key is a nested bucket.
+// The returned value is only valid for the life of the transaction.
func (b *Bucket) Get(key []byte) []byte {
k, v, flags := b.Cursor().seek(key)