Add any type and output errors

This commit is contained in:
Archie Fox
2025-03-14 15:11:17 +03:00
parent debf1eec22
commit e7bb6ba60a
4 changed files with 25 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"password/account"
"password/files"
"password/output"
"github.com/fatih/color"
)
@@ -55,7 +56,7 @@ func deleteAccount(vault *account.VaultWithDb) {
if isDeleted {
color.Green("Удалено")
} else {
color.Red("Не найдено")
output.PrintError("Не найдено")
}
}
@@ -66,7 +67,7 @@ func createAccount(vault *account.VaultWithDb) {
myAccount, err := account.NewAccount(login, password, url)
if err != nil {
fmt.Println("ОШИБКА: Неверный формат URL или Login")
output.PrintError("ОШИБКА: Неверный формат URL или Login")
return
}
vault.AddAccount(*myAccount)