package main import ( "flag" "log" "time" ) var ( port *int ) func main() { // parse the command line flags parseFlags() // periocically get the stats from all companion containers go func() { for { // get stats listDockerContainers() time.Sleep(1 * time.Second) } }() // setup a http server displaying the scoreboard log.Println("setting up the http server") httpServer := setupHTTPServer() // start the http server log.Println("Starting the http server") log.Fatalln(httpServer.ListenAndServe()) } // parseFlags parses the command line flags func parseFlags() { port = flag.Int("port", 8080, "Port the http server should run on") flag.Parse() }