code: func (tm *transactionManager) transaction(
  	key string, keyType int) *transaction {
  
  	sm := tm.transactions
  	if keyType == 1 {
  		sm = tm.index
  	}
  
  	v, ok := sm.Get(key)
  	if !ok {
  		return nil
  	}
  
  	return v.(*transaction)
  }
docs: // transaction returns a transaction. keyType should be one of 0, 1 which
  // represents transId and index each.