From 3b5b8283db8fc62dfad60a00292ab18f70c5eade Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 10 Aug 2020 10:35:53 +0800 Subject: [PATCH] update goctl go generator --- tools/goctl/api/gogen/genmain.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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() } `