26 lines
550 B
Go
26 lines
550 B
Go
package ui
|
|
|
|
func inputsEmpty(user, pass, pass2, first, last, role string) bool {
|
|
return len(user) == 0 ||
|
|
len(pass) == 0 ||
|
|
len(pass2) == 0 ||
|
|
len(first) == 0 ||
|
|
len(last) == 0 ||
|
|
len(role) == 0
|
|
}
|
|
|
|
func checkUserStrings(user, first, last string) (string, int, bool) {
|
|
userLen := 15
|
|
nameLen := 50
|
|
|
|
if len(user) > userLen {
|
|
return "Benutzername", userLen, false
|
|
} else if len(first) > nameLen {
|
|
return "Vorname", nameLen, false
|
|
} else if len(last) > nameLen {
|
|
return "Nachname", nameLen, false
|
|
} else {
|
|
return "", 0, true
|
|
}
|
|
}
|