keys/keybase.go
func (kb dbKeybase) Delete(name, passphrase string) error {
	// verify we have the proper password before deleting
	info, err := kb.Get(name)
	if err != nil {
		return err
	}
	switch info.(type) {
	case localInfo:
		linfo := info.(localInfo)
		_, err = unarmorDecryptPrivKey(linfo.PrivKeyArmor, passphrase)
		if err != nil {
			return err
		}
		kb.db.DeleteSync(infoKey(name))
		return nil
	case ledgerInfo:
	case offlineInfo:
		if passphrase != "yes" {
			return fmt.Errorf("enter exactly 'yes' to delete the key")
		}
		kb.db.DeleteSync(infoKey(name))
		return nil
	}
	return nil
}
func (kb dbKeybase) Delete(name, passphrase string) error {
	// verify we have the proper password before deleting
	info, err := kb.Get(name)
	if err != nil {
		return err
	}
	switch info.(type) {
	case localInfo:
		linfo := info.(localInfo)
		_, err = unarmorDecryptPrivKey(linfo.PrivKeyArmor, passphrase)
		if err != nil {
			return err
		}
		kb.db.DeleteSync(infoKey(name))
		return nil
	case ledgerInfo:
	case offlineInfo:
		if passphrase != "yes" {
			return fmt.Errorf("enter exactly 'yes' to delete the key")
		}
		kb.db.DeleteSync(infoKey(name))
		return nil
	}
	return nil
}
func ( kb dbKeybase ) Delete ( name , passphrase string ) error { // verify we have the proper password before deleting info , err := kb . Get ( name ) if err != nil { return err } switch info . ( type ) { case localInfo : linfo := info . ( localInfo ) _ , err = unarmorDecryptPrivKey ( linfo . PrivKeyArmor , passphrase ) if err != nil { return err } kb . db . DeleteSync ( infoKey ( name ) ) return nil case ledgerInfo : case offlineInfo : if passphrase != " " { return fmt . Errorf ( " " ) } kb . db . DeleteSync ( infoKey ( name ) ) return nil } return nil }
// Delete removes key forever, but we must present the
// proper passphrase before deleting it (for security).
// A passphrase of 'yes' is used to delete stored
// references to offline and Ledger / HW wallet keys
Delete removes key forever but we must present the proper passphrase before deleting it ( for security ) . A passphrase of yes is used to delete stored references to offline and Ledger / HW wallet keys