Add function transformation data on JSON

This commit is contained in:
Archie Fox
2025-03-06 23:58:58 +03:00
parent b5941ea148
commit 26e125577d
7 changed files with 94 additions and 25 deletions

View File

@@ -3,17 +3,27 @@ package main
import (
"fmt"
"password/account"
"password/files"
)
func main() {
createdAccount()
}
func createdAccount() {
login := account.PromptData("Введите логин: ")
password := account.PromptData("Введите пароль: ")
url := account.PromptData("Введите URL: ")
myAccount, err := account.NewAccountWithTimeStamp(login, password, url)
myAccount, err := account.NewAccount(login, password, url)
if err != nil {
fmt.Println("ОШИБКА: Неверный формат URL")
return
}
myAccount.OutputPassword()
file, err := myAccount.ToBytes()
if err != nil {
fmt.Println("Не удалось преобразовать в JSON")
return
}
files.FileWrite(file, "data.json")
}