func main() { r, err := registry.GetRegistry() if err != nil { fmt.Printf("Service exited with error: %s\n", err) os.Exit(255) } if err := service.Run(r); err != nil { fmt.Printf("Service exited with error: %s\n", err) os.Exit(255) } else { fmt.Println("Service exited gracefully") } }
func main() { log.InitWithConfig(log.Config{Name: "console"}) r, err := registry.GetRegistry() if err != nil { log.Errorf("Error: %s\n", err) return } cmd := command.NewCommand(r) if err := cmd.Run(os.Args); err != nil { log.Errorf("Error: %s\n", err) } }