layed out websockets

This commit is contained in:
Hazel Noack
2025-07-01 12:51:40 +02:00
parent 74ea6270c8
commit 0dc8871bb8
2 changed files with 13 additions and 0 deletions

View File

@@ -115,3 +115,13 @@ func (s *Session) GuessLetter(letter string) (*Session, error) {
return s, nil
}
func (s *Session) GetUserByName(name string) (*User, error) {
for _, u := range s.Users {
if u.Name == name {
return &u, nil
}
}
return nil, errors.New("nu user with the name " + name + " found in " + s.Name)
}