Skip to content

Instantly share code, notes, and snippets.

@matryer
Created June 1, 2019 11:34
Show Gist options
  • Save matryer/cb8c249b3d4a2dc3d4f0d00d3b1aba45 to your computer and use it in GitHub Desktop.
Save matryer/cb8c249b3d4a2dc3d4f0d00d3b1aba45 to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"fmt"
"os"
"os/exec"
)
var speakers = map[string]bool{
"Eduardo Alves": true,
"Bastian Winkler": true,
"Xabi": true,
"The Italian Trio. Filippo Valsorda, Roberto Clapis, Giovanni Bajo": true,
"Tiago Mendes": true,
"Denys Nahurnyi": true,
"Syamala Umamaheswaran": true,
"Takuya Ueda": true,
"Wojtek Siudzinski": true,
"Haiko Schol": true,
"Egon Elbre": true,
}
func main() {
s := bufio.NewScanner(os.Stdin)
// first speaker is fixed
announce("Joonatan Samuel")
s.Scan()
// second speaker is fixed
announce("Carlos Guzman")
// the rest... random baby!
for name := range speakers {
s.Scan() // they pressed enter
announce(name)
}
}
func announce(name string) {
fmt.Println("Next up:", name)
exec.Command("say", "Next up, please welcome the wonderful "+name).Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment