Separate main() to allow for external inclusion

This commit is contained in:
Justin Li 2014-07-15 23:06:07 -04:00
parent fbcf762a42
commit 6623098853

View file

@ -30,11 +30,10 @@ func init() {
flag.StringVar(&configPath, "config", "", "Provide the filesystem path of a valid configuration file.") flag.StringVar(&configPath, "config", "", "Provide the filesystem path of a valid configuration file.")
} }
func main() { func Boot() {
defer glog.Flush() defer glog.Flush()
flag.Parse() flag.Parse()
glog.Info("parsed flags")
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())
glog.Info("set gomaxprocs to ", runtime.NumCPU()) glog.Info("set gomaxprocs to ", runtime.NumCPU())
@ -68,3 +67,7 @@ func main() {
http.Serve(cfg) http.Serve(cfg)
glog.Info("gracefully shutdown") glog.Info("gracefully shutdown")
} }
func main() {
Boot()
}