layed out websockets
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user