Skip to content

Instantly share code, notes, and snippets.

View fabioxgn's full-sized avatar
🏠
Working from home

Fábio Gomes fabioxgn

🏠
Working from home
  • Leme, SP - Brazil
View GitHub Profile
@fabioxgn
fabioxgn / channels.go
Created May 21, 2014 02:13
First time using channels
func execute(cmd *Cmd, conn ircConnection) {
done := make(chan bool, len(list))
for k, v := range list {
cmdName := k
cmdFunc := v
go func() {
result := cmdFunc(cmd)
conn.Privmsg(cmd.Channel, result)
done <- true