Skip to content

Instantly share code, notes, and snippets.

@avalchev94
Created May 26, 2020 16:11
Show Gist options
  • Save avalchev94/035f24f298b56d0f3f726e74e09c9e91 to your computer and use it in GitHub Desktop.
Save avalchev94/035f24f298b56d0f3f726e74e09c9e91 to your computer and use it in GitHub Desktop.
How would you fix me?
client := &Client{
username: ....,
send: make(chan *profiles.Profile, 100),
}
clients[clientId] = client
// .......
for _, client := range clients {
select {
case client.send <- profileChange:
logger.Debugf("profile change send...")
default:
logger.Errorf("failed to send profile change, channel is full")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment