func main() { if serviceRegistration != "" { if err := goconsul.RegisterService(); err != nil { log.Fatal(err) } } flag.Parse() NewRouter(ramlFile) if version != "" { logChannel("build", fmt.Sprintf("build date: %s commit: %s", buildstamp, githash)) } logChannel("information", fmt.Sprintf("%s up on port %s", serviceName, port)) log.Fatal(http.ListenAndServe(port, nil)) }
func main() { if os.Getenv("SERVICE_REGISTRATION") == "1" { if err := goconsul.RegisterService(); err != nil { log.Fatal(err) } } flag.Parse() web.NewRouter(buildstamp, githash) if version != "" { journal.LogChannel("build", fmt.Sprintf("build date: %s commit: %s", buildstamp, githash)) } journal.LogChannel("information", fmt.Sprintf("%s up on port %s", serviceName, port)) log.Fatal(http.ListenAndServe(port, nil)) }