mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
refactor: changed removing secret from store returns error
This commit is contained in:
parent
c3e1b40e3b
commit
0333caa403
3 changed files with 11 additions and 4 deletions
|
|
@ -102,10 +102,16 @@ func (l *LocalSecretStore) ListSecrets() (map[string]string, error) {
|
|||
}
|
||||
|
||||
// RemoveSecretByID removes the specified secretID stored locally
|
||||
func (l *LocalSecretStore) RemoveSecretByID(secretID string) {
|
||||
func (l *LocalSecretStore) RemoveSecretByID(secretID string) error {
|
||||
l.mu.RLock()
|
||||
// Let user know if there was nothing to delete
|
||||
_, err := l.GetSecretByID(secretID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
delete(l.Secrets, secretID)
|
||||
l.mu.RUnlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
// openStore tries to create or open the LocalSecretStore based on the environment
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue