diff --git a/tools/goctl/api/gogen/genmain.go b/tools/goctl/api/gogen/genmain.go index 311af99d..55d46e10 100644 --- a/tools/goctl/api/gogen/genmain.go +++ b/tools/goctl/api/gogen/genmain.go @@ -30,12 +30,11 @@ func main() { conf.MustLoad(*configFile, &c) ctx := svc.NewServiceContext(c) + server := rest.MustNewServer(c.RestConf) + defer server.Stop() - engine := rest.MustNewServer(c.RestConf) - defer engine.Stop() - - handler.RegisterHandlers(engine, ctx) - engine.Start() + handler.RegisterHandlers(server, ctx) + server.Start() } `