Skip to content

Commit

Permalink
Merge pull request #35 from andygrunwald/client-example-closing
Browse files Browse the repository at this point in the history
Client Example: Fix closing order
  • Loading branch information
michaelklishin committed Jan 20, 2022
2 parents 667f951 + 8460ac6 commit 51fade5
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 51fade5

Please sign in to comment.