func main() { flag.Parse() if showVersion { fmt.Fprintln(os.Stderr, os.Args[0], version) return } var config godoauth.Config if err := config.Parse(confFile); err != nil { fmt.Fprintln(os.Stderr, "error parsing config file: ", err) os.Exit(1) } fmt.Printf("Starting %s version: %s\n", name, version) server, err := godoauth.NewServer(&config) if err != nil { fmt.Fprintln(os.Stderr, "Error while creating new server: ", err) os.Exit(1) } server.Start() // waiting for a termination signal to clean up interruptChan := make(chan os.Signal) signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP) <-interruptChan }