Skip to content

Commit

Permalink
Client Example: Fix closing order
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrunwald committed Jan 13, 2022
1 parent 21ccfde commit 8460ac6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion example_client_test.go
Expand Up @@ -278,6 +278,7 @@ func (session *Session) Close() error {
if !session.isReady {
return errAlreadyClosed
}
close(session.done)
err := session.channel.Close()
if err != nil {
return err
Expand All @@ -286,7 +287,7 @@ func (session *Session) Close() error {
if err != nil {
return err
}
close(session.done)

session.isReady = false
return nil
}

0 comments on commit 8460ac6

Please sign in to comment.