Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
fix: errorMessage type assertion (#550)
Browse files Browse the repository at this point in the history
* fix: errorMessage type assertion 

errorMessage type assertion should use pointer type

* fix: use errors.As instead of type assertion
  • Loading branch information
daidehu6831 authored Dec 11, 2022
1 parent 913e8c2 commit 9b8a2e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package socketio

import (
"errors"
"net/http"

"github.com/gomodule/redigo/redis"
Expand Down Expand Up @@ -237,8 +238,8 @@ func (s *Server) serveError(c *conn) {
case <-c.quitChan:
return
case err := <-c.errorChan:
errMsg, ok := err.(errorMessage)
if !ok {
var errMsg *errorMessage
if !errors.As(err, &errMsg) {
continue
}

Expand Down

0 comments on commit 9b8a2e8

Please sign in to comment.