code: func (r *keyring) Remove(key ssh.PublicKey) error {
  	r.mu.Lock()
  	defer r.mu.Unlock()
  	if r.locked {
  		return errLocked
  	}
  
  	want := key.Marshal()
  	found := false
  	for i := 0; i < len(r.keys); {
  		if bytes.Equal(r.keys[i].signer.PublicKey().Marshal(), want) {
  			found = true
  			r.keys[i] = r.keys[len(r.keys)-1]
  			r.keys = r.keys[len(r.keys)-1:]
  			continue
  		} else {
  			i++
  		}
  	}
  
  	if !found {
  		return errors.New("agent: key not found")
  	}
  	return nil
  }
docs: // Remove removes all identities with the given public key.