Remove check for account and use returned error

This commit is contained in:
Till Faelligen 2020-06-01 14:09:17 +02:00
parent 3f4b0b5554
commit da5154297c

View file

@ -69,13 +69,10 @@ func main() {
os.Exit(1)
}
account, err := accountDB.CreateAccount(context.Background(), *username, *password, "")
_, err = accountDB.CreateAccount(context.Background(), *username, *password, "")
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
} else if account == nil {
fmt.Println("Username already exists")
os.Exit(1)
}
deviceDB, err := devices.NewDatabase(*database, nil, serverName)