From db070776b180c51bfd3974005fecf9cd7c928e24 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Wed, 18 Oct 2023 16:26:04 +0200 Subject: [PATCH] server.newParticipant() vereinfacht --- packages/server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/server.go b/packages/server/server.go index e526e9a..8ecd25c 100644 --- a/packages/server/server.go +++ b/packages/server/server.go @@ -105,14 +105,14 @@ func loginIsCorrect(l string, logins *[]string) bool { } func newParticipant(l string) (*types.Participant, error) { + var err error p := new(types.Participant) - idInt, err := strconv.Atoi(strings.Split(l, "-")[0]) + p.ID, err = strconv.Atoi(strings.Split(l, "-")[0]) if err != nil { return nil, fmt.Errorf("newParticipant: strconv.Atoi(idString): %v\n", err) } - p.ID = int64(idInt) return p, nil }