Skip to content

Commit

Permalink
fixed: use log package
Browse files Browse the repository at this point in the history
  • Loading branch information
primalmotion committed May 1, 2019
1 parent 6fca61e commit 95685ae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wsc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"context"
"encoding/binary"
"fmt"
"log"
"net/http"
"time"

Expand Down Expand Up @@ -249,7 +250,9 @@ func (s *ws) done(err error) {
select {
case s.doneChan <- err:
default:
fmt.Printf("error: unable to send done message: error: %s\n", err)
if err != nil {
log.Printf("wsc: error: unable to send done message: error: %s\n", err)
}
}
}

Expand All @@ -258,6 +261,8 @@ func (s *ws) error(err error) {
select {
case s.errChan <- err:
default:
fmt.Printf("error: unable to send error: %s\n", err)
if err != nil {
log.Printf("wsc: error: unable to send error: %s\n", err)
}
}
}

0 comments on commit 95685ae

Please sign in to comment.