Skip to content

Instantly share code, notes, and snippets.

@murphybytes
Last active November 10, 2015 22:05
Show Gist options
  • Select an option

  • Save murphybytes/a70d8182915df583bc32 to your computer and use it in GitHub Desktop.

Select an option

Save murphybytes/a70d8182915df583bc32 to your computer and use it in GitHub Desktop.
if idIf, ok := m.Data["id"]; ok {
switch idIf.(type) {
case float64:
id := int64(idIf.(float64))
c.hMu.Lock()
defer c.hMu.Unlock()
if ch, ok := c.handler[id]; ok {
delete(c.handler, id)
ch <- *m
close(ch)
return
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment