Created
October 21, 2018 19:25
-
-
Save ehsun7b/479279f0f20e999f8e3a0dc6b762066c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *Server) SignOut(request string, response *string) error { | |
if request == "" { | |
*response = "empty request. sign out failed" | |
} else { | |
if s.clients == nil { | |
*response = "you are not signed in" | |
} else if _, ok := s.clients[request]; !ok { | |
*response = "you are not signed in" | |
} else { | |
delete(s.clients, request) | |
*response = "signed out successfully" | |
log.Printf("%v signed out. Clients: %v", request, s.clients) | |
} | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment