func init() { logs.Init(Debug) fmt.Println("Reading config...") if err := router.Init("../data/config.json"); err != nil { fmt.Errorf("Init() failed: %s", err) } }
func init() { var configFile string flag.BoolVar(&Debug, "debug", false, "Activates debug logging.") flag.StringVar(&configFile, "config", "data/config.json", "Config file. This is a full or relative path.") flag.Parse() logs.Init(Debug) if err := router.Init(configFile); err != nil { log.Fatal("Unable to start - data initilization failed.\n") } go signalHandler(make(chan os.Signal, 1)) fmt.Println("Press Ctrl-C to shutdown...") time.Sleep(time.Second * 2) services.Refresh() }