Browse Source

fixes from gometalinter review

pull/1842/head
Anton Kaliaev 8 years ago
parent
commit
992c54253f
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      pubsub/pubsub.go

+ 4
- 4
pubsub/pubsub.go View File

@ -110,8 +110,8 @@ func (s *Server) Unsubscribe(ctx context.Context, clientID string, query Query)
}
}
// Unsubscribe removes all client subscriptions. An error will be returned to
// the caller if the context is canceled.
// UnsubscribeAll removes all client subscriptions. An error will be returned
// to the caller if the context is canceled.
func (s *Server) UnsubscribeAll(ctx context.Context, clientID string) error {
select {
case s.cmds <- cmd{op: unsub, clientID: clientID}:
@ -172,7 +172,7 @@ loop:
state.removeAll(cmd.clientID)
}
case shutdown:
for clientID, _ := range state.clients {
for clientID := range state.clients {
state.removeAll(clientID)
}
break loop
@ -232,7 +232,7 @@ func (state *state) removeAll(clientID string) {
return
}
for q, _ := range queryMap {
for q := range queryMap {
ch := state.queries[q][clientID]
close(ch)


Loading…
Cancel
Save