boltdb/bolt

Can I use the same key for nested bucket and filed in a bucket/

zhengxiaoyao0716 opened this issue · 1 comments

How to understand the comments of bucket.Get mehod?
It says that Returns a nil value if the key does not exist or if the key is a nested bucket.,
Then if I could do something like those:

b.Put(key, value)
b.CreateBucket(key)

value := b.Get(key)
bucket := b.Bucket(key)

Is it a correctly and recommend usage?
What my means is, is there no-interference each other between field and nested bucket?

Well, I take a try and found that, it was forbid to use same key with conflict value. This maybe more rigovous, and I suggest that if you can add this as a notice to the code comments?
And in ForEach function, I found that the v param of the callback would be nil if it is actually a bucket, but nothing statement for this behavour in the comments found.