Use constant error for Sessions
This commit is contained in:
@@ -277,7 +277,7 @@ func (m *Melody) BroadcastBinaryOthers(msg []byte, s *Session) error {
|
|||||||
// Sessions returns all sessions. An error is returned if the melody session is closed.
|
// Sessions returns all sessions. An error is returned if the melody session is closed.
|
||||||
func (m *Melody) Sessions() ([]*Session, error) {
|
func (m *Melody) Sessions() ([]*Session, error) {
|
||||||
if m.hub.closed() {
|
if m.hub.closed() {
|
||||||
return nil, errors.New("melody instance is closed")
|
return nil, ErrClosed
|
||||||
}
|
}
|
||||||
return m.hub.all(), nil
|
return m.hub.all(), nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user