From 5f9559f227d35426880a20cda02363ee0e27fb2b Mon Sep 17 00:00:00 2001 From: Luke Champine Date: Mon, 21 Sep 2015 15:49:06 -0400 Subject: [PATCH] Document undefined behavior in ForEach --- bucket.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bucket.go b/bucket.go index 6766992..8c3edae 100644 --- a/bucket.go +++ b/bucket.go @@ -346,7 +346,8 @@ func (b *Bucket) NextSequence() (uint64, error) { // ForEach executes a function for each key/value pair in a bucket. // If the provided function returns an error then the iteration is stopped and -// the error is returned to the caller. +// the error is returned to the caller. The provided function must not modify +// the bucket; this will result in undefined behavior. func (b *Bucket) ForEach(fn func(k, v []byte) error) error { if b.tx.db == nil { return ErrTxClosed