Add function transformation data on JSON
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user