You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Bucket retrieves a bucket by name.// Returns nil if the bucket does not exist.// The bucket instance is only valid for the lifetime of the transaction.func (tx*Tx) Bucket(name []byte) *Bucket {
returntx.root.Bucket(name)
}
The comment says Returns nil if the bucket does not exist. but actually new bucket is created if it does not exist.
Update: did some more testing, it seems it returns a bucket when a new db is created and opened, and actually returns nil after the bucket is explicitly deleted using DeleteBucket(name)