code: func (b *Bucket) Put(key []byte, value []byte) error {
  	if b.tx.db == nil {
  		return ErrTxClosed
  	} else if !b.Writable() {
  		return ErrTxNotWritable
  	} else if len(key) == 0 {
  		return ErrKeyRequired
  	} else if len(key) > MaxKeySize {
  		return ErrKeyTooLarge
  	} else if int64(len(value)) > MaxValueSize {
  		return ErrValueTooLarge
  	}
  
  	// Move cursor to correct position.
  	c := b.Cursor()
  	k, _, flags := c.seek(key)
  
  	// Return an error if there is an existing key with a bucket value.
  	if bytes.Equal(key, k) && (flags&bucketLeafFlag) != 0 {
  		return ErrIncompatibleValue
  	}
  
  	// Insert into node.
  	key = cloneBytes(key)
  	c.node().put(key, key, value, 0, 0)
  
  	return nil
  }
docs: // Put sets the value for a key in the bucket.
  // If the key exist then its previous value will be overwritten.
  // Supplied value must remain valid for the life of the transaction.
  // Returns an error if the bucket was created from a read-only transaction, if the key is blank, if the key is too large, or if the value is too large.