code: func (tx *transaction) fetchKey(key []byte) []byte {
  	// When the transaction is writable, check the pending transaction
  	// state first.
  	if tx.writable {
  		if tx.pendingRemove.Has(key) {
  			return nil
  		}
  		if value := tx.pendingKeys.Get(key); value != nil {
  			return value
  		}
  	}
  
  	// Consult the database cache and underlying database.
  	return tx.snapshot.Get(key)
  }
docs: // fetchKey attempts to fetch the provided key from the database cache (and
  // hence underlying database) while taking into account the current transaction
  // state.  Returns nil if the key does not exist.