func Init(path, file string) { if err := env.Load(path, file); err != nil { panic(err.Error()) } var err error if TaskSaver, err = saver.NewSaver(); err != nil { panic(err.Error()) } }
func main() { if err := env.Load("conf", "scheduler.conf"); err != nil { panic(err.Error()) } defer env.Close() sch, err := scheduler.NewScheduler() if err != nil { panic("init scheduler error: " + err.Error()) } sch.Work() }
func main() { var svr *saver.Saver var err error if err := env.Load("conf", "saver.conf"); err != nil { panic(err.Error()) } defer env.Close() if svr, err = saver.NewSaver(); err != nil { panic("init saver error : " + err.Error()) } svr.Work() }