From b8950dc04c0f784a3b033e3327af11eca5a2007e Mon Sep 17 00:00:00 2001 From: Aleksandr Zelenin Date: Thu, 25 Oct 2018 15:20:19 +0300 Subject: [PATCH] fix --- client/authorization.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/authorization.go b/client/authorization.go index 7933766..4652614 100644 --- a/client/authorization.go +++ b/client/authorization.go @@ -122,7 +122,11 @@ func (stateHandler *clientAuthorizer) Close() { func CliInteractor(clientAuthorizer *clientAuthorizer) { for { select { - case state := <-clientAuthorizer.State: + case state, ok := <-clientAuthorizer.State: + if !ok { + return + } + switch state.AuthorizationStateType() { case TypeAuthorizationStateWaitPhoneNumber: fmt.Println("Enter phone number: ")