server.newParticipant() vereinfacht
This commit is contained in:
parent
3e9cfb49eb
commit
db070776b1
@ -105,14 +105,14 @@ func loginIsCorrect(l string, logins *[]string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newParticipant(l string) (*types.Participant, error) {
|
func newParticipant(l string) (*types.Participant, error) {
|
||||||
|
var err error
|
||||||
p := new(types.Participant)
|
p := new(types.Participant)
|
||||||
|
|
||||||
idInt, err := strconv.Atoi(strings.Split(l, "-")[0])
|
p.ID, err = strconv.Atoi(strings.Split(l, "-")[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("newParticipant: strconv.Atoi(idString): %v\n", err)
|
return nil, fmt.Errorf("newParticipant: strconv.Atoi(idString): %v\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.ID = int64(idInt)
|
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user